Skip to content

Commit

Permalink
Fix default account selection. Specific backup (#4159)
Browse files Browse the repository at this point in the history
* fix default account selection

* restore second backup

* Fix crash

* Fix potential crash

Co-authored-by: Bruno Barbieri <[email protected]>
Co-authored-by: Terry Sahaidak <[email protected]>
  • Loading branch information
3 people authored and estebanmino committed Sep 13, 2022
1 parent d74c7ba commit 0b372e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function AlreadyBackedUpView() {

const walletStatus = useMemo(() => {
let status = null;
if (wallets?.[walletId].backedUp) {
if (wallets?.[walletId]?.backedUp) {
if (wallets?.[walletId].backupType === WalletBackupTypes.manual) {
status = WalletBackupStatus.MANUAL_BACKUP;
} else {
Expand Down Expand Up @@ -133,7 +133,7 @@ export default function AlreadyBackedUpView() {

const { colors, isDarkMode } = useTheme();

const isSecretPhrase = WalletTypes.mnemonic === wallets?.[walletId].type;
const isSecretPhrase = WalletTypes.mnemonic === wallets?.[walletId]?.type;

const handleViewRecoveryPhrase = useCallback(() => {
navigate('ShowSecretView', {
Expand Down
5 changes: 4 additions & 1 deletion src/handlers/cloudBackup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ export async function getDataFromCloud(backupPassword: any, filename = null) {
);
} else {
document = backups.files.find((file: any) => {
return file.name === `${REMOTE_BACKUP_WALLET_DIR}/${filename}`;
return (
file.name === `${REMOTE_BACKUP_WALLET_DIR}/${filename}` ||
file.name === filename
);
});
}

Expand Down

0 comments on commit 0b372e8

Please sign in to comment.