Skip to content

Commit

Permalink
[FIX] wallet status update
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbazan7 committed Feb 5, 2025
1 parent ea22373 commit b361e1c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/store/wallet/wallet.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,14 +632,17 @@ export const walletReducer = (
});

// Update wallet statuses
walletBalances.forEach(({keyId, walletId, status}) => {
if (updatedKeys[keyId]?.wallets?.[walletId]) {
updatedKeys[keyId].wallets[walletId] = {
...updatedKeys[keyId].wallets[walletId],
balance: status.balance,
pendingTxps: status.pendingTxps,
singleAddress: status.singleAddress,
};
walletBalances.forEach(({ keyId, walletId, status }) => {
if (updatedKeys[keyId]?.wallets?.length > 0) {
updatedKeys[keyId].wallets = updatedKeys[keyId].wallets.map((wallet) => {
if (wallet.id === walletId) {
wallet.balance = status.balance;
wallet.pendingTxps = status.pendingTxps;
wallet.isRefreshing = false;
wallet.singleAddress = status.singleAddress;
}
return wallet;
});
}
});

Expand Down

0 comments on commit b361e1c

Please sign in to comment.