From 3fcf3bc3b8861b96816dc0c9315a370f32d74d6a Mon Sep 17 00:00:00 2001 From: Anastasiia Sokolova <63446892+sokolova-an@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:19:09 +0100 Subject: [PATCH] fix: rename accounts update (#2665) --- .../RenameWallet/model/rename-wallet-model.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/renderer/features/wallets/RenameWallet/model/rename-wallet-model.ts b/src/renderer/features/wallets/RenameWallet/model/rename-wallet-model.ts index 2c73fcc39..93945cbaa 100644 --- a/src/renderer/features/wallets/RenameWallet/model/rename-wallet-model.ts +++ b/src/renderer/features/wallets/RenameWallet/model/rename-wallet-model.ts @@ -6,7 +6,6 @@ import { storageService } from '@/shared/api/storage'; import { type Wallet } from '@/shared/core'; import { nonNullable } from '@/shared/lib/utils'; import { walletModel, walletUtils } from '@/entities/wallet'; -import { walletConnectModel } from '@/entities/walletConnect'; export type Callbacks = { onSubmit: () => void; @@ -45,6 +44,7 @@ const $walletForm = createForm({ const renameWalletFx = createEffect(async ({ id, accounts, ...rest }: Wallet): Promise => { await storageService.wallets.update(id, rest); + await storageService.accounts.updateAll(accounts); return { id, accounts, ...rest }; }); @@ -90,18 +90,6 @@ sample({ target: renameWalletFx, }); -sample({ - clock: renameWalletFx.doneData, - filter: (updatedWallet) => { - return !walletUtils.isPolkadotVault(updatedWallet) && !walletUtils.isMultiShard(updatedWallet); - }, - fn: (updatedWallet) => ({ - walletId: updatedWallet.id, - accounts: updatedWallet.accounts, - }), - target: walletConnectModel.events.accountsUpdated, -}); - sample({ clock: renameWalletFx.doneData, fn: (updatedWallet) => {