From 0c2725eda06bc5d862cc2253c9d9b4a7dc285ad7 Mon Sep 17 00:00:00 2001 From: dotneB Date: Thu, 10 Oct 2024 18:24:28 -0400 Subject: [PATCH] fix: prevent moves after puzzle completion (#406) Fixes #384 --- src/components/puzzles/PuzzleBoard.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/puzzles/PuzzleBoard.tsx b/src/components/puzzles/PuzzleBoard.tsx index 0852a696..21cce348 100644 --- a/src/components/puzzles/PuzzleBoard.tsx +++ b/src/components/puzzles/PuzzleBoard.tsx @@ -146,7 +146,9 @@ function PuzzleBoard({ movable={{ free: false, color: - puzzle && equal(position, Array(currentMove).fill(0)) + puzzle && + equal(position, Array(currentMove).fill(0)) && + puzzle.completion === "incomplete" ? turn : undefined, dests: dests,