Skip to content

Commit

Permalink
add imported check on backup prompt (#6377)
Browse files Browse the repository at this point in the history
* add imported check on backup prompt

* add navigation to backup prompt on new group creation
  • Loading branch information
walmat authored Jan 3, 2025
1 parent 64de9d5 commit 5722852
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/handlers/walletReadyEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ export const runWalletBackupStatusChecks = async (): Promise<boolean> => {
const { selected } = store.getState().wallets;
if (!selected || IS_TEST) return false;

if (!selected.backedUp && !selected.damaged && selected.type !== WalletTypes.readOnly && selected.type !== WalletTypes.bluetooth) {
if (
!selected.backedUp &&
!selected.damaged &&
!selected.imported &&
selected.type !== WalletTypes.readOnly &&
selected.type !== WalletTypes.bluetooth
) {
logger.debug('[walletReadyEvents]: Selected wallet is not backed up, prompting backup sheet');
return promptForBackupOnceReadyOrNotAvailable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import WalletBackupTypes from '@/helpers/walletBackupTypes';
import WalletTypes, { EthereumWalletType } from '@/helpers/walletTypes';
import ImageAvatar from '@/components/contacts/ImageAvatar';
import { useENSAvatar, useInitializeWallet, useManageCloudBackups, useWallets } from '@/hooks';
import { useNavigation } from '@/navigation';
import { Navigation, useNavigation } from '@/navigation';
import { abbreviations, deviceUtils } from '@/utils';
import { addressHashedEmoji } from '@/utils/profileUtils';
import * as i18n from '@/languages';
Expand Down Expand Up @@ -38,6 +38,7 @@ import { executeFnIfCloudBackupAvailable } from '@/model/backup';
import { walletLoadingStore } from '@/state/walletLoading/walletLoading';
import { AbsolutePortalRoot } from '@/components/AbsolutePortal';
import { FlatList, ScrollView } from 'react-native';
import walletBackupStepTypes from '@/helpers/walletBackupStepTypes';

type WalletPillProps = {
account: RainbowAccount;
Expand Down Expand Up @@ -198,6 +199,9 @@ export const WalletsAndBackup = () => {
loadingState: null,
});
scrollviewRef.current?.scrollTo({ y: 0, animated: true });
Navigation.handleAction(Routes.BACKUP_SHEET, {
step: walletBackupStepTypes.backup_prompt,
});
}
},
});
Expand Down

0 comments on commit 5722852

Please sign in to comment.