Skip to content

Commit

Permalink
reset backup provider to undefined if no condition is met
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Nov 18, 2024
1 parent 7b18523 commit 1f42ab9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useManageCloudBackups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -96,7 +95,7 @@ export default function useManageCloudBackups() {
if (_buttonIndex === 1 && IS_ANDROID) {
logoutFromGoogleDrive();
setAccountDetails(undefined);
removeBackupStateFromAllWallets().then(() => loginToGoogleDrive());
loginToGoogleDrive();
}
}
);
Expand Down
2 changes: 2 additions & 0 deletions src/state/backups/backups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export const backupsStore = createRainbowStore<BackupsStore>((set, get) => ({
});
} else if (hasManuallyBackedUpWallet(wallets)) {
set({ backupProvider: walletBackupTypes.manual });
} else {
set({ backupProvider: undefined });
}

logger.debug(`[backupsStore]: Retrieved ${backups.files.length} backup files`);
Expand Down

0 comments on commit 1f42ab9

Please sign in to comment.