Skip to content

Commit 50b3647

Browse files
fix: issue with visiting previous puzzles
1 parent 3b91505 commit 50b3647

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/pages/train.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ const Train: React.FC<Props> = ({
262262
[string, string] | null
263263
>(null)
264264

265-
const showAnalysis = status === 'correct' || status === 'forfeit'
265+
const showAnalysis =
266+
status === 'correct' || status === 'forfeit' || status === 'archived'
266267

267268
const currentPlayer = useMemo(() => {
268269
const currentNode = showAnalysis
@@ -271,12 +272,6 @@ const Train: React.FC<Props> = ({
271272
return getCurrentPlayer(currentNode)
272273
}, [showAnalysis, analysisController.currentNode, controller.currentNode])
273274

274-
useEffect(() => {
275-
if (controller.currentNode.fen === controller.puzzleStartingNode.fen) {
276-
setStatus('default')
277-
}
278-
}, [controller.currentNode])
279-
280275
useEffect(() => {
281276
if (showAnalysis && !analysisSyncedRef.current) {
282277
// Set the analysis controller to the current training controller's node

0 commit comments

Comments
 (0)