Skip to content

Commit

Permalink
Check to avoid triggering UI update if the balance is the same
Browse files Browse the repository at this point in the history
  • Loading branch information
n9lsjr committed Feb 13, 2024
1 parent 4bd2d7f commit 3627ad7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routes/wallet/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
$node.localDaemonBlockCount = data.localDaemonBlockCount;
$node.networkBlockCount = data.networkBlockCount;
$node.walletBlockCount = data.walletBlockCount;
$wallet.balance = data.balance;
//Check to avoid triggering UI update if the balance is the same
if (data.balance[0] != localStorage.getItem('balance')) {
$wallet.balance = data.balance;
}
$user.idleTime = data.idle ?? 0;
localStorage.setItem('balance', data.balance[0]);
});
Expand Down

0 comments on commit 3627ad7

Please sign in to comment.