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/android/app/build.gradle b/packages/mobile/android/app/build.gradle index ef0441fb9..f6584c79e 100644 --- a/packages/mobile/android/app/build.gradle +++ b/packages/mobile/android/app/build.gradle @@ -92,7 +92,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 433 - versionName "4.0.0" + versionName "4.0.1" missingDimensionStrategy 'react-native-camera', 'general' missingDimensionStrategy 'store', 'play' } diff --git a/packages/mobile/ios/ton_keeper.xcodeproj/project.pbxproj b/packages/mobile/ios/ton_keeper.xcodeproj/project.pbxproj index 3742e1b05..05e38f21d 100644 --- a/packages/mobile/ios/ton_keeper.xcodeproj/project.pbxproj +++ b/packages/mobile/ios/ton_keeper.xcodeproj/project.pbxproj @@ -1294,7 +1294,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 4.0.0; + MARKETING_VERSION = 4.0.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1328,7 +1328,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 4.0.0; + MARKETING_VERSION = 4.0.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/packages/mobile/src/hooks/useMigration.ts b/packages/mobile/src/hooks/useMigration.ts index 855721763..e91e2f4a8 100644 --- a/packages/mobile/src/hooks/useMigration.ts +++ b/packages/mobile/src/hooks/useMigration.ts @@ -22,12 +22,8 @@ export const useMigration = () => { if (isNewSecurityFlow) { const keychainService = await AsyncStorage.getItem('keychainService'); - if (!keychainService) { - throw new Error(); - } - jsonstr = await SecureStore.getItemAsync('biometry_' + keychainItemName, { - keychainService, + keychainService: keychainService || 'TKProtected', }); } else { jsonstr = await EncryptedStorage.getItem(keychainItemName); 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 ? (