reload personal opening explorer data on board flip

openingexplorer3
Thibault Duplessis 2021-10-19 09:51:03 +02:00
parent 88ab7ac864
commit 7eadfc9862
4 changed files with 10 additions and 9 deletions

View File

@ -226,6 +226,7 @@ export default class AnalyseCtrl {
this.retro = makeRetro(this, this.bottomColor());
}
if (this.practice) this.restartPractice();
this.explorer.onFlip();
this.redraw();
};

View File

@ -16,7 +16,7 @@ export function controller(game: Game, onClose: () => void, trans: Trans, redraw
if (variant === 'standard') available.unshift('masters');
const data: ExplorerConfigData = {
open: prop(true),
open: prop(false),
db: {
available,
selected:

View File

@ -173,16 +173,15 @@ export default function (root: AnalyseCtrl, opts: ExplorerOpts, allow: boolean):
}
},
setHovering(fen, uci) {
hovering(
uci
? {
fen,
uci,
}
: null
);
hovering(uci ? { fen, uci } : null);
root.setAutoShapes();
},
onFlip() {
if (config.data.db.selected() == 'player') {
cache = {};
setNode();
}
},
fetchMasterOpening: (() => {
const masterCache: Dictionary<OpeningData> = {};
return (fen: Fen): Promise<OpeningData> => {

View File

@ -156,6 +156,7 @@ export interface ExplorerCtrl {
toggle(): void;
disable(): void;
setHovering(fen: Fen, uci: Uci | null): void;
onFlip(): void;
fetchMasterOpening(fen: Fen): Promise<OpeningData>;
fetchTablebaseHit(fen: Fen): Promise<SimpleTablebaseHit>;
}