This commit is contained in:
Maciej Caderek
2022-02-22 18:47:18 +01:00
parent 707b9cce61
commit ce3167fc7c
10 changed files with 37 additions and 28 deletions

View File

@@ -21,7 +21,6 @@ const defaultConfig: BoardConfig = {
showChecks: true,
showCoords: true,
flipped: false,
anonymous: false,
};
const defaultHeader: Header = {
@@ -41,6 +40,7 @@ const defaultHeader: Header = {
class Board {
private cfg: BoardConfig = defaultConfig;
private _anonymous: boolean = false;
private scale: number = 1;
@@ -90,6 +90,11 @@ class Board {
}
}
set anonymous(value: boolean) {
this._anonymous = value;
this.refresh();
}
async refresh() {
await this.renderBackground();
@@ -197,7 +202,7 @@ class Board {
}
private getFinalHeader() {
return this.cfg.anonymous
return this._anonymous
? {
...this.header,
White: "Anonymous",