IPVGO: Remove current game history from savefile, re-implement superko (#1175)

This commit is contained in:
Michael Ficocelli
2024-03-20 20:37:20 -04:00
committed by GitHub
parent fc8958af83
commit 1e5f7184a2
12 changed files with 45 additions and 29 deletions
+2 -1
View File
@@ -38,7 +38,7 @@ export function GoTutorialChallenge({
const [showReset, setShowReset] = useState(false);
const handleClick = (x: number, y: number) => {
if (stateRef.current.previousBoard) {
if (stateRef.current.previousBoards.length) {
SnackbarEvents.emit(`Hit 'Reset' to try again`, ToastVariant.WARNING, 2000);
return;
}
@@ -67,6 +67,7 @@ export function GoTutorialChallenge({
const reset = () => {
stateRef.current = getStateCopy(state);
stateRef.current.previousBoards = [];
setDisplayText(description);
setShowReset(false);
};