From a6020e102f5a5a431abd874a7f76707ba20affb1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 21 Jul 2023 19:49:45 +0200 Subject: Fix sorted tiles when observing. --- play.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/play.js b/play.js index cfd9fa1..28530db 100644 --- a/play.js +++ b/play.js @@ -204,7 +204,8 @@ function on_update() { let red_court = view.red_court let blue_court = view.blue_court if (opt_sort_tiles) { - hand = hand.slice().sort(cmp_tile) + if (hand) + hand = hand.slice().sort(cmp_tile) red_court = red_court.slice().sort(cmp_tile) blue_court = blue_court.slice().sort(cmp_tile) } -- cgit v1.2.3