From 972e308e9a13874aca0a51dba269bed64ae3b37e Mon Sep 17 00:00:00 2001 From: Alex Chaplinsky Date: Tue, 17 Sep 2019 00:58:23 +0200 Subject: [PATCH] Update gdrive sync --- src/main/application/sync/gdrive/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/application/sync/gdrive/index.js b/src/main/application/sync/gdrive/index.js index 5799cfe1..1044459d 100644 --- a/src/main/application/sync/gdrive/index.js +++ b/src/main/application/sync/gdrive/index.js @@ -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)) }) })