diff --git a/packages/@core-js/src/utils/State.ts b/packages/@core-js/src/utils/State.ts index b0c43ef23..a1a40c589 100644 --- a/packages/@core-js/src/utils/State.ts +++ b/packages/@core-js/src/utils/State.ts @@ -98,6 +98,15 @@ export class State { this.storeIfNeeded(); }; + public setAsync = async ( + updater: Partial | ((data: TData) => Partial), + ) => { + const newData = typeof updater === 'function' ? updater(this.data) : updater; + this.data = { ...this.data, ...newData }; + this.emit(); + await this.storeIfNeeded(); + }; + private emit() { this.subscribers.forEach((subscriber) => subscriber(this.data)); } diff --git a/packages/mobile/src/navigation/MainStack/MainStack.tsx b/packages/mobile/src/navigation/MainStack/MainStack.tsx index 1f8300cbe..c2a9f5106 100644 --- a/packages/mobile/src/navigation/MainStack/MainStack.tsx +++ b/packages/mobile/src/navigation/MainStack/MainStack.tsx @@ -63,7 +63,7 @@ export const MainStack: FC = () => { const showLockScreen = tk.lockEnabled && !isUnlocked && hasWallet && !attachedScreen.pathname; - const isMigrated = useExternalState(tk.walletsStore, (state) => state.isMigrated); + const isMigrated = useExternalState(tk.migrationStore, (state) => state.isMigrated); const root = useMemo(() => { if (hasWallet) { diff --git a/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx b/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx index 0b03553ec..9b56fb282 100644 --- a/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx +++ b/packages/mobile/src/screens/BackupPhraseScreen/BackupPhraseScreen.tsx @@ -41,43 +41,45 @@ export const BackupPhraseScreen = memo(() => { return ( - - - {t('recovery_phrase.title')} - - - - {t('recovery_phrase.caption')} - - + + + + {t('recovery_phrase.title')} + + + + {t('recovery_phrase.caption')} + + - - - - {leftColumn.map((word, index) => ( - - - {index + 1}. - - {word} - - ))} - - - {rightColumn.map((word, index) => ( - - - {index + 1 + 12}. - - {word} - - ))} + + + + {leftColumn.map((word, index) => ( + + + {index + 1}. + + {word} + + ))} + + + {rightColumn.map((word, index) => ( + + + {index + 1 + 12}. + + {word} + + ))} + - - - + + + {lastBackupAt !== null && !params.isBackupAgain ? (