From 891b997b38bd0d76a0e73cbea4b0e1d490173f09 Mon Sep 17 00:00:00 2001 From: dionaditya Date: Tue, 7 Jan 2020 17:14:43 +0700 Subject: [PATCH 1/2] Fix bug issue#147 --- app/core/account.js | 9 ++++---- package.json | 52 ++++++++++++++++++++++----------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/app/core/account.js b/app/core/account.js index 6df588b..c12521a 100644 --- a/app/core/account.js +++ b/app/core/account.js @@ -5,7 +5,7 @@ const EventEmitter = require('events'); const Sync = require('./sync'); const globals = require('../../config/globals'); -const OAuth2 = google.auth.OAuth2; +const OAuth2 = google.google.auth.OAuth2; const toSave = ["email", "about", "tokens", "folder", "saveTime", "permanentlyDeleteSetting"]; @@ -64,9 +64,9 @@ class Account extends EventEmitter { if (err) { return reject(err); } - + this.about = about; - this.email = about.user.emailAddress; + this.email = about.data.emailAddress; this.save().then(resolve, reject); }); @@ -128,9 +128,10 @@ class Account extends EventEmitter { onTokensReceived(tokens) { this.tokens = tokens; + console.log(tokens) this.oauth.setCredentials(tokens); - this.drive = google.drive({ + this.drive = google.google.drive({ version: 'v3', auth: this.oauth }); diff --git a/package.json b/package.json index 6df7b32..cb38982 100644 --- a/package.json +++ b/package.json @@ -10,41 +10,41 @@ "array-unique": "^0.3.2", "auto-launch": "^5.0.5", "body-parser": "^1.19.0", - "bootstrap": "4.3.1", - "chokidar": "^3.0.0", + "bootstrap": "4.4.1", + "chokidar": "^3.3.1", "command-line-args": "^5.1.1", - "deep-equal": "^1.0.1", - "delay": "^4.2.0", - "ejs": "^2.6.2", + "deep-equal": "^2.0.1", + "delay": "^4.3.0", + "ejs": "^3.0.1", "express": "^4.17.1", - "file-loader": "^4.0.0", + "file-loader": "^5.0.2", "font-awesome": "^4.7.0", - "fs-extra": "^8.0.1", - "googleapis": "^22.2.0", - "jquery": "^3.4.0", + "fs-extra": "^8.1.0", + "googleapis": "^46.0.0", + "jquery": "^3.4.1", "md5-file": "^4.0.0", "mkdirp-promise": "^5.0.1", "morgan": "^1.9.1", "nedb-promise": "^2.0.1", - "node-notifier": "^5.4.0", - "node-sass": "^4.12.0", - "popper.js": "^1.15.0", - "sass-loader": "^7.1.0", - "tether": "^1.4.6" + "node-notifier": "^6.0.0", + "node-sass": "^4.13.0", + "popper.js": "^1.16.0", + "sass-loader": "^8.0.0", + "tether": "^1.4.7" }, "devDependencies": { - "copy-webpack-plugin": "^5.0.3", - "css-loader": "^3.1.0", - "electron": "^4.2.8", - "electron-builder": "^20.40.2", - "electron-packager": "^13.1.1", - "eslint": "^6.1.0", - "mini-css-extract-plugin": "^0.8.0", - "resolve-url-loader": "^3.1.0", - "style-loader": "^0.23.1", - "url-loader": "^2.0.0", - "webpack": "^4.30.0", - "webpack-cli": "^3.3.1" + "copy-webpack-plugin": "^5.1.1", + "css-loader": "^3.4.1", + "electron": "^7.1.7", + "electron-builder": "^21.2.0", + "electron-packager": "^14.1.1", + "eslint": "^6.8.0", + "mini-css-extract-plugin": "^0.9.0", + "resolve-url-loader": "^3.1.1", + "style-loader": "^1.1.2", + "url-loader": "^3.0.0", + "webpack": "^4.41.5", + "webpack-cli": "^3.3.10" }, "scripts": { "lint": "eslint app main.js", From cda812f72c07f545e52545ac6f377ba322a47208 Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Tue, 7 Jan 2020 10:16:16 +0000 Subject: [PATCH 2/2] [CodeFactor] Apply fixes to commit 891b997 --- app/core/account.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/account.js b/app/core/account.js index c12521a..9aaa8db 100644 --- a/app/core/account.js +++ b/app/core/account.js @@ -128,7 +128,7 @@ class Account extends EventEmitter { onTokensReceived(tokens) { this.tokens = tokens; - console.log(tokens) + console.log(tokens); this.oauth.setCredentials(tokens); this.drive = google.google.drive({