Skip to content

Commit

Permalink
request cloud evals when toggling the option
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 24, 2024
1 parent 62d88a0 commit 77e89ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui/analyse/src/study/multiBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 77e89ca

Please sign in to comment.