From d521f4fd9e73badeb8fbbd509b2f53e786d3fb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Santana=20Gon=C3=A7alves?= Date: Fri, 29 Sep 2023 08:23:40 -0300 Subject: [PATCH] fix wallet backup does not show mnemonic (#757) --- src/screens/info/ShowMnemonicScreen.tsx | 6 +++++- src/screens/settings/WalletBackup.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/screens/info/ShowMnemonicScreen.tsx b/src/screens/info/ShowMnemonicScreen.tsx index ca5059243..03648ff7a 100644 --- a/src/screens/info/ShowMnemonicScreen.tsx +++ b/src/screens/info/ShowMnemonicScreen.tsx @@ -13,6 +13,7 @@ import { settingsStackRouteNames, } from 'navigation/settingsNavigator/types' import { headerLeftOption } from 'navigation/profileNavigator' +import { getCurrentChainId } from 'src/storage/ChainStorage' export enum TestID { Mnemonic = 'Mnemonic.Text', @@ -31,7 +32,10 @@ export const ShowMnemonicScreen = ({ const fn = async () => { const keys = await getKeys() if (keys) { - const { kms } = KeyManagementSystem.fromSerialized(keys) + const { kms } = KeyManagementSystem.fromSerialized( + keys, + getCurrentChainId(), + ) setMnemonic(kms.mnemonic) } } diff --git a/src/screens/settings/WalletBackup.tsx b/src/screens/settings/WalletBackup.tsx index e7a4c2bd9..5123b946f 100644 --- a/src/screens/settings/WalletBackup.tsx +++ b/src/screens/settings/WalletBackup.tsx @@ -18,6 +18,7 @@ import { import { castStyle } from 'shared/utils' import { getKeys } from 'storage/SecureStorage' import { DeleteWalletModal } from 'components/modal/deleteWalletModal' +import { getCurrentChainId } from 'src/storage/ChainStorage' type Props = SettingsScreenProps @@ -33,7 +34,10 @@ export const WalletBackup = (_: Props) => { const fn = async () => { const keys = await getKeys() if (keys) { - const { kms } = KeyManagementSystem.fromSerialized(keys) + const { kms } = KeyManagementSystem.fromSerialized( + keys, + getCurrentChainId(), + ) setMnemonic(kms.mnemonic) } }