Skip to content

Commit

Permalink
Update gdrive sync
Browse files Browse the repository at this point in the history
  • Loading branch information
alchaplinsky committed Sep 16, 2019
1 parent 6495721 commit 972e308
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/application/sync/gdrive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ export default class GDrive {

getFileContents() {
const drive = google.drive({ version: 'v3', auth: this.client.getAuth() })

return new Promise((resolve, reject) => {
return new Promise(resolve => {
folderExists(this.folderName, drive).then(folderId => {
if (!folderId) reject()
if (!folderId) return resolve(false)
return fileExists(this.fileName, folderId, drive).then(fileId => {
if (!fileId) reject()
if (!fileId) return resolve(false)
return readFile(fileId, drive).then(data => resolve(data))
})
})
Expand Down

0 comments on commit 972e308

Please sign in to comment.