From 139a63343afc587ab95089d8d79d0c89616129d2 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 27 Oct 2023 09:34:52 +0300 Subject: [PATCH] fix: setClient --- src/web3/store/transactionsSlice.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/web3/store/transactionsSlice.ts b/src/web3/store/transactionsSlice.ts index 22e444b..f76c36c 100644 --- a/src/web3/store/transactionsSlice.ts +++ b/src/web3/store/transactionsSlice.ts @@ -231,9 +231,11 @@ export function createTransactionsSlice({ }, setClient: (chainId, client) => { - const stateClients = get().clients; - const updatedClients = (stateClients[chainId] = client); - set({ clients: updatedClients }); + set((state) => + produce(state, (draft) => { + draft.clients[chainId] = client as Draft; + }), + ); }, isGelatoAvailable: true,