Skip to content

Commit

Permalink
Prevent case where tip amount can display as negative (#4519)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Oct 6, 2023
1 parent 160cfb1 commit e665887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/openchat-client/src/stores/localMessageUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class LocalMessageUpdatesStore extends LocalUpdatesStore<bigint, LocalMes
result.tips[ledger][userId] = result.tips[ledger][userId] + amount;
}

if (result.tips[ledger][userId] === 0n) {
if (result.tips[ledger][userId] <= 0n) {
delete result.tips[ledger][userId];
}

Expand Down

0 comments on commit e665887

Please sign in to comment.