avoid comfirmation if all rack are empty
authorLaurent Mazet <mazet@softndesign.org>
Sat, 22 Aug 2026 16:57:39 +0000 (18:57 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sat, 22 Aug 2026 16:57:39 +0000 (18:57 +0200)
public/trivabble.js

index 5fe3b9a1276e7bb4994a8f6d02f08f4a07ce8b02..bc376a043c33620add06238961295211e69458c1 100644 (file)
     }
 
     function askShowBag() {
-        myConfirm(
-            _("Do you really want to see bag content? It's kind of cheating!"),
-            function () {
-                sendCmds([{cmd: "showBag"}]);
-            }
-        );
+        if (nbTilesInRacks) {
+            myConfirm(
+                _("Do you really want to see bag content? It's kind of cheating!"),
+                function () {
+                    sendCmds([{cmd: "showBag"}]);
+                }
+            );
+        } else {
+            sendCmds([{cmd: "showBag"}]);
+        }
     }
 
     function triggerFlashLight(cell) {