From 77e89ca11c4eacf2d9dff5badad33be8c6caadfb Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Wed, 24 Jan 2024 10:42:38 +0100 Subject: [PATCH] request cloud evals when toggling the option --- ui/analyse/src/study/multiBoard.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/analyse/src/study/multiBoard.ts b/ui/analyse/src/study/multiBoard.ts index 5440b05330b3d..1afba56d1a95e 100644 --- a/ui/analyse/src/study/multiBoard.ts +++ b/ui/analyse/src/study/multiBoard.ts @@ -34,7 +34,10 @@ export class MultiBoardCtrl { private readonly send: SocketSend, private readonly variant: () => VariantKey, ) { - this.showEval = storedBooleanPropWithEffect('analyse.multiboard.showEval', true, redraw); + this.showEval = storedBooleanPropWithEffect('analyse.multiboard.showEval', true, () => { + redraw(); + this.requestCloudEvals(); + }); } addNode = (pos: Position, node: Tree.Node) => { @@ -82,12 +85,11 @@ export class MultiBoardCtrl { }; private requestCloudEvals = () => { - if (this.pager?.currentPageResults.length) { + if (this.pager?.currentPageResults.length && this.showEval()) this.send('evalGetMulti', { fens: this.pager?.currentPageResults.map(c => c.fen), ...(this.variant() != 'standard' ? { variant: this.variant() } : {}), }); - } }; reloadEventually = debounce(this.reload, 1000);