diff --git a/ui/analyse/src/ctrl.ts b/ui/analyse/src/ctrl.ts index 9b38a584a797..3cb0f2ca7a1a 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 7f4131989a86..7a728e42d766 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}`);