Skip to content

Commit

Permalink
Merge pull request #208 from Suhas1104/drive-fix
Browse files Browse the repository at this point in the history
fix for google drive
  • Loading branch information
alchaplinsky authored Jul 17, 2024
2 parents 4457acd + 736f666 commit e0ad267
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/application/sync/gdrive/drive.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class Drive {

async readFile(id) {
const { data } = await this.drive.files.get({ fileId: id, alt: 'media' })
return data
return data.text()
}

async updateFile(id, content) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/application/sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import GDrive from './gdrive'
import { mergeData } from './base/merge'

const NO_INTERNET_CONNECTION = 'Swifty seems to be offline'
const NOT_CONFIGURED = 'Sync is not configured'
const FAILED_TO_FIND_REMOTE_VAULT = 'Failed to find remote vault file'
const FAILED_TO_CREATE_REMOTE_VAULT = 'Failed to create remote vault file'
const FAILED_TO_READ_REMOTE_VAULT = 'Failed to read remote vault file'
Expand All @@ -19,7 +18,9 @@ export default class Sync {
}

async perform() {
if (!this.isConfigured()) throw Error(NOT_CONFIGURED)
if (!this.isConfigured()) {
this.provider.setup()
}

if (!(await this.remoteVaultExists())) {
await this.createRemoteVault()
Expand Down

0 comments on commit e0ad267

Please sign in to comment.