Skip to content

Commit 96d5711

Browse files
authored
🐞 fix: add undo check to prevent negative scores (#61)
1 parent 967a032 commit 96d5711

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ export function resetScores() {
364364
}
365365

366366
export function undoLastScore() {
367-
if (!lastScoringPlayer) {
367+
if (!lastScoringPlayer ||
368+
currentMatchScores[lastScoringPlayer] <= 0) {
368369
showSnackBar(lang('ui.tooltip.noScoreToUndo'), 'NoScoreToUndo', 'warning');
369370
return;
370371
}

0 commit comments

Comments
 (0)