diff --git a/packages/core/src/service/walletService.ts b/packages/core/src/service/walletService.ts index 81109159e..0f6d95152 100644 --- a/packages/core/src/service/walletService.ts +++ b/packages/core/src/service/walletService.ts @@ -167,13 +167,17 @@ const createPayloadOfStandardTonAccount = async ( return { name, emoji, publicKey, walletAuth, walletIdToActivate, wallets }; }; -export const createAccountId = ( +export const mayBeCreateAccountId = ( network: Network, publicKey: string | undefined ): AccountId | undefined => { if (!publicKey) { return undefined; } + return createAccountId(network, publicKey); +}; + +const createAccountId = (network: Network, publicKey: string): AccountId => { if (network === Network.TESTNET) { return `testnet-${publicKey}`; } else { diff --git a/packages/uikit/src/components/create/ChoseWalletVersions.tsx b/packages/uikit/src/components/create/ChoseWalletVersions.tsx index 3948184e3..53bb41335 100644 --- a/packages/uikit/src/components/create/ChoseWalletVersions.tsx +++ b/packages/uikit/src/components/create/ChoseWalletVersions.tsx @@ -21,7 +21,7 @@ import { isAccountTonWalletStandard } from '@tonkeeper/core/dist/entries/account import { mnemonicToKeypair } from '@tonkeeper/core/dist/service/mnemonicService'; import { MnemonicType } from '@tonkeeper/core/dist/entries/password'; import { Network } from '@tonkeeper/core/dist/entries/network'; -import { createAccountId } from '@tonkeeper/core/dist/service/walletService'; +import { mayBeCreateAccountId } from '@tonkeeper/core/dist/service/walletService'; const Wrapper = styled.div` flex: 1; @@ -80,7 +80,7 @@ export const ChoseWalletVersions: FC<{ const [publicKey, setPublicKey] = useState(undefined); const { data: wallets } = useStandardTonWalletVersions(network, publicKey); const [checkedVersions, setCheckedVersions] = useState([]); - const accountState = useAccountState(createAccountId(network, publicKey)); + const accountState = useAccountState(mayBeCreateAccountId(network, publicKey)); useEffect(() => { if (sdk.isIOs()) {