From 1f42ab96394c7ae7dc08c303199d1220eab299e8 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Mon, 18 Nov 2024 14:05:05 -0500 Subject: [PATCH] reset backup provider to undefined if no condition is met --- src/hooks/useManageCloudBackups.ts | 3 +-- src/state/backups/backups.ts | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useManageCloudBackups.ts b/src/hooks/useManageCloudBackups.ts index 526d75ad26a..1a50c8b079d 100644 --- a/src/hooks/useManageCloudBackups.ts +++ b/src/hooks/useManageCloudBackups.ts @@ -50,7 +50,6 @@ export default function useManageCloudBackups() { }; const loginToGoogleDrive = async () => { - // TODO: Figure out how to update the backup status based on the new account? try { const accountDetails = await getGoogleAccountUserData(); backupsStore.getState().syncAndFetchBackups(); @@ -96,7 +95,7 @@ export default function useManageCloudBackups() { if (_buttonIndex === 1 && IS_ANDROID) { logoutFromGoogleDrive(); setAccountDetails(undefined); - removeBackupStateFromAllWallets().then(() => loginToGoogleDrive()); + loginToGoogleDrive(); } } ); diff --git a/src/state/backups/backups.ts b/src/state/backups/backups.ts index 3148fa7482a..74e34ec3cf3 100644 --- a/src/state/backups/backups.ts +++ b/src/state/backups/backups.ts @@ -115,6 +115,8 @@ export const backupsStore = createRainbowStore((set, get) => ({ }); } else if (hasManuallyBackedUpWallet(wallets)) { set({ backupProvider: walletBackupTypes.manual }); + } else { + set({ backupProvider: undefined }); } logger.debug(`[backupsStore]: Retrieved ${backups.files.length} backup files`);