From 86fe0a66142fbe27e96df9c40a88e8feac7571e1 Mon Sep 17 00:00:00 2001 From: johndoknjas Date: Sat, 28 Dec 2024 22:52:21 -0800 Subject: [PATCH] Give the ply limit alert on all types of analysis boards, not just study ones. --- ui/analyse/src/ctrl.ts | 3 ++- ui/analyse/src/study/studyCtrl.ts | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/analyse/src/ctrl.ts b/ui/analyse/src/ctrl.ts index 9b38a584a7971..3cb0f2ca7a1a3 100644 --- a/ui/analyse/src/ctrl.ts +++ b/ui/analyse/src/ctrl.ts @@ -575,7 +575,8 @@ export default class AnalyseCtrl { } onPremoveSet = () => { - if (this.study) this.study.onPremoveSet(); + if (this.node.dests === '') alert('Too many moves for a lichess board.'); + else if (this.study) this.study.onPremoveSet(); }; addNode(node: Tree.Node, path: Tree.Path) { diff --git a/ui/analyse/src/study/studyCtrl.ts b/ui/analyse/src/study/studyCtrl.ts index 7f4131989a86e..7a728e42d766f 100644 --- a/ui/analyse/src/study/studyCtrl.ts +++ b/ui/analyse/src/study/studyCtrl.ts @@ -594,10 +594,7 @@ export default class StudyCtrl { }; explorerGame = (gameId: string, insert: boolean) => this.makeChange('explorerGame', this.withPosition({ gameId, insert })); - onPremoveSet = () => { - if (this.currentNode().dests === '') alert('Too many moves for a lichess board.'); - else this.gamebookPlay?.onPremoveSet(); - }; + onPremoveSet = () => this.gamebookPlay?.onPremoveSet(); baseUrl = () => { const current = location.href; const studyIdOffset = current.indexOf(`/${this.data.id}`);