From d38c0f9997aa8f9d4db2dd590aae0afbf1c48e47 Mon Sep 17 00:00:00 2001 From: cpl121 Date: Tue, 10 Oct 2023 13:10:04 +0200 Subject: [PATCH] fix: error when finding and claiming shimmer --- packages/shared/lib/core/account/utils/getBoundAccount.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shared/lib/core/account/utils/getBoundAccount.ts b/packages/shared/lib/core/account/utils/getBoundAccount.ts index 3432d4b58a0..5b27e1d54b0 100644 --- a/packages/shared/lib/core/account/utils/getBoundAccount.ts +++ b/packages/shared/lib/core/account/utils/getBoundAccount.ts @@ -1,5 +1,4 @@ import { IAccount, UnableToGetBoundAccountError } from '@core/account' -import { WalletRsError } from '@core/error' import { createAccount, getAccount, profileManager as _profileManager } from '@core/profile-manager' export async function getBoundAccount( @@ -16,7 +15,8 @@ export async function getBoundAccount( const account = await getAccount(accountIndex ?? 0, profileManager) return account } catch (err) { - if (err?.type === WalletRsError?.AccountNotFound && createAccountsIfNotFound) { + // TODO: Update error type when sdk Error enum has been updated + if (err?.type === 'wallet' && createAccountsIfNotFound) { for (let indexToCreateAccount = 0; indexToCreateAccount < accountIndex; indexToCreateAccount++) { const account = await createAccount({}, profileManager) if (account?.getMetadata()?.index === accountIndex) {