File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -302,11 +302,18 @@ export const currency: TamePixie<RootProps> = combinePixies({
302302 subscriptionTimeoutId = undefined
303303 }
304304
305+ // Refresh state to avoid using stale wallet data after the await:
306+ const { wallets : freshWallets } = input . props . state . currency
307+
305308 const subscriptionUpdates : Map < string , ChangeServiceSubscription [ ] > =
306309 new Map ( )
307310 for ( let i = 0 ; i < results . length ; i ++ ) {
308311 const result = results [ i ]
309- const { walletId, wallet } = indexToWalletId [ i ]
312+ const { walletId } = indexToWalletId [ i ]
313+ const wallet = freshWallets [ walletId ]
314+
315+ // Skip if wallet was removed during await:
316+ if ( wallet == null ) continue
310317
311318 // Determine the new status of the subscription to all addresses
312319 // for the wallet:
You can’t perform that action at this time.
0 commit comments