Skip to content

Commit

Permalink
remember multiboard.showEval value using local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 24, 2024
1 parent 2708616 commit e4b3664
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/analyse/src/study/multiBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { ChapterPreview, ChapterPreviewPlayer, Position, StudyChapterMeta } from
import StudyCtrl from './studyCtrl';
import { EvalHitMulti } from '../interfaces';
import { povChances } from 'ceval/src/winningChances';
import { Toggle, defined, toggle } from 'common';
import { Prop, defined } from 'common';
import { storedBooleanPropWithEffect } from 'common/storage';

interface CloudEval extends EvalHitMulti {
chances: number;
Expand All @@ -22,7 +23,7 @@ export class MultiBoardCtrl {
page = 1;
pager?: Paginator<ChapterPreview>;
playing = false;
showEval: Toggle;
showEval: Prop<boolean>;

private cloudEvals: Map<Fen, CloudEval> = new Map();

Expand All @@ -33,7 +34,7 @@ export class MultiBoardCtrl {
private readonly send: SocketSend,
private readonly variant: () => VariantKey,
) {
this.showEval = toggle(false, redraw);
this.showEval = storedBooleanPropWithEffect('analyse.multiboard.showEval', false, redraw);
}

addNode = (pos: Position, node: Tree.Node) => {
Expand Down

0 comments on commit e4b3664

Please sign in to comment.