From 3c57d046e6e02ff167a5f4620dfc7247f52cc888 Mon Sep 17 00:00:00 2001 From: mayuran-deriv <129507167+mayuran-deriv@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:23:01 +0400 Subject: [PATCH] fix: 400 error (#17528) --- packages/bot-web-ui/src/stores/google-drive-store.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/bot-web-ui/src/stores/google-drive-store.ts b/packages/bot-web-ui/src/stores/google-drive-store.ts index a23d9104bc0b..6188a4c14298 100644 --- a/packages/bot-web-ui/src/stores/google-drive-store.ts +++ b/packages/bot-web-ui/src/stores/google-drive-store.ts @@ -104,6 +104,7 @@ export default class GoogleDriveStore { this.setIsAuthorized(true); localStorage.setItem('google_access_token', response.access_token); this.setGoogleDriveTokenExpiry(response?.expires_in); + this.setGoogleDriveTokenValid(true); } }, }); @@ -137,8 +138,10 @@ export default class GoogleDriveStore { async signOut() { if (this.access_token) { await window?.gapi?.client?.setToken({ access_token: '' }); - await window?.google?.accounts?.oauth2?.revoke(this.access_token); - localStorage?.removeItem('google_access_token'); + if (localStorage.getItem('google_access_token')) { + await window?.google?.accounts?.oauth2?.revoke(this.access_token); + localStorage?.removeItem('google_access_token'); + } this.access_token = ''; } this.setIsAuthorized(false);