From d25d9725401cbb05830ff452a5fe782f1a82a920 Mon Sep 17 00:00:00 2001 From: ByteZhang Date: Tue, 6 Sep 2022 15:42:57 +0800 Subject: [PATCH] fix: Create hw wallet chagne account error (#1485) --- packages/kit/src/background/services/ServiceAccount.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/background/services/ServiceAccount.ts b/packages/kit/src/background/services/ServiceAccount.ts index e68d20af7a3..8ee5a07e69d 100644 --- a/packages/kit/src/background/services/ServiceAccount.ts +++ b/packages/kit/src/background/services/ServiceAccount.ts @@ -676,6 +676,9 @@ class ServiceAccount extends ServiceBase { } } + const walletId = wallet?.id; + const accountId = account?.id; + const status: { boardingCompleted: boolean } = appSelector((s) => s.status); if (!status.boardingCompleted) { dispatch(setBoardingCompleted()); @@ -686,8 +689,8 @@ class ServiceAccount extends ServiceBase { await this.initWallets(); serviceAccount.changeActiveAccount({ - accountId: account?.id ?? null, - walletId: wallet?.id ?? null, + accountId: accountId ?? null, + walletId: walletId ?? null, }); return wallet; }