From 94b8a96c16093c6aa808ab62c4d863bf4e78f62c Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Fri, 20 Dec 2024 17:24:22 -0500 Subject: [PATCH 1/2] fix and others i18n (#6367) --- src/components/Discover/TrendingTokens.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Discover/TrendingTokens.tsx b/src/components/Discover/TrendingTokens.tsx index de88bc4b52e..223a8041981 100644 --- a/src/components/Discover/TrendingTokens.tsx +++ b/src/components/Discover/TrendingTokens.tsx @@ -280,7 +280,7 @@ function FriendHolders({ friends }: { friends: FarcasterUser[] }) { {friends.length > 2 && ( {' '} - {i18n.t('trending_tokens.and_others', { count: howManyOthers })} + {i18n.t(t.and_others[howManyOthers === 1 ? 'one' : 'other'], { count: howManyOthers })} )} From 0f4f232e99b2abbb642ebf8b3af69f3414f46f9b Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Fri, 20 Dec 2024 17:26:59 -0500 Subject: [PATCH 2/2] Prevent backup prompt from firing on import (#6364) * remove backup prompt from importing flow as it runs in the walletReady flow now * fix potential race condition --- src/handlers/walletReadyEvents.ts | 10 ++++------ src/hooks/useImportingWallet.ts | 18 ------------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/handlers/walletReadyEvents.ts b/src/handlers/walletReadyEvents.ts index b62749da519..b8e53674c66 100644 --- a/src/handlers/walletReadyEvents.ts +++ b/src/handlers/walletReadyEvents.ts @@ -28,10 +28,10 @@ const delay = (ms: number) => }); const promptForBackupOnceReadyOrNotAvailable = async (): Promise => { - const { status } = backupsStore.getState(); - if (LoadingStates.includes(status)) { + let { status } = backupsStore.getState(); + while (LoadingStates.includes(status)) { await delay(1000); - return promptForBackupOnceReadyOrNotAvailable(); + status = backupsStore.getState().status; } logger.debug(`[walletReadyEvents]: BackupSheet: showing backup now sheet for selected wallet`); @@ -47,9 +47,7 @@ export const runWalletBackupStatusChecks = async (): Promise => { const { selected } = store.getState().wallets; if (!selected || IS_TEST) return false; - const selectedWalletNeedsBackedUp = - !selected.backedUp && !selected.damaged && selected.type !== WalletTypes.readOnly && selected.type !== WalletTypes.bluetooth; - if (selectedWalletNeedsBackedUp) { + if (!selected.backedUp && !selected.damaged && selected.type !== WalletTypes.readOnly && selected.type !== WalletTypes.bluetooth) { logger.debug('[walletReadyEvents]: Selected wallet is not backed up, prompting backup sheet'); return promptForBackupOnceReadyOrNotAvailable(); } diff --git a/src/hooks/useImportingWallet.ts b/src/hooks/useImportingWallet.ts index f1cde6313da..096099c8f61 100644 --- a/src/hooks/useImportingWallet.ts +++ b/src/hooks/useImportingWallet.ts @@ -339,24 +339,6 @@ export default function useImportingWallet({ showImportModal = true } = {}) { }); }, 1_000); - setTimeout(() => { - // If it's not read only or hardware, show the backup sheet - if ( - !( - isENSAddressFormat(input) || - isUnstoppableAddressFormat(input) || - isValidAddress(input) || - isValidBluetoothDeviceId(input) - ) - ) { - if (!IS_TEST) { - Navigation.handleAction(Routes.BACKUP_SHEET, { - step: WalletBackupStepTypes.backup_prompt, - }); - } - } - }, 1000); - analytics.track('Imported seed phrase', { isWalletEthZero, });