From e4b36648fe19be6e7e3c1c121d0134b10d6ace7f Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Wed, 24 Jan 2024 10:22:25 +0100 Subject: [PATCH] remember multiboard.showEval value using local storage --- ui/analyse/src/study/multiBoard.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/analyse/src/study/multiBoard.ts b/ui/analyse/src/study/multiBoard.ts index 57135ea990c08..d6dd50c929c78 100644 --- a/ui/analyse/src/study/multiBoard.ts +++ b/ui/analyse/src/study/multiBoard.ts @@ -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; @@ -22,7 +23,7 @@ export class MultiBoardCtrl { page = 1; pager?: Paginator; playing = false; - showEval: Toggle; + showEval: Prop; private cloudEvals: Map = new Map(); @@ -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) => {