feat(config): show / hide info on load
This commit is contained in:
@@ -603,10 +603,14 @@ function initWhiteboard() {
|
||||
// fix bug cursor not showing up
|
||||
whiteboard.refreshCursorAppearance();
|
||||
|
||||
if (process.env.NODE_ENV === "production" && ConfigService.readOnlyOnWhiteboardLoad) {
|
||||
ReadOnlyService.activateReadOnlyMode();
|
||||
InfoService.hideInfo();
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
if (ConfigService.readOnlyOnWhiteboardLoad) ReadOnlyService.activateReadOnlyMode();
|
||||
else ReadOnlyService.deactivateReadOnlyMode();
|
||||
|
||||
if (ConfigService.displayInfoOnWhiteboardLoad) InfoService.displayInfo();
|
||||
else InfoService.hideInfo();
|
||||
} else {
|
||||
// in dev
|
||||
ReadOnlyService.deactivateReadOnlyMode();
|
||||
InfoService.displayInfo();
|
||||
}
|
||||
|
||||
@@ -10,11 +10,15 @@ class ConfigService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @type {{displayInfo: boolean, setReadOnly: boolean}}
|
||||
* @readonly
|
||||
*/
|
||||
#readOnlyOnWhiteboardLoad = false;
|
||||
#onWhiteboardLoad = { setReadOnly: false, displayInfo: false };
|
||||
get readOnlyOnWhiteboardLoad() {
|
||||
return this.#readOnlyOnWhiteboardLoad;
|
||||
return this.#onWhiteboardLoad.setReadOnly;
|
||||
}
|
||||
get displayInfoOnWhiteboardLoad() {
|
||||
return this.#onWhiteboardLoad.displayInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,9 +54,9 @@ class ConfigService {
|
||||
this.#configFromServer = configFromServer;
|
||||
|
||||
const { common } = configFromServer;
|
||||
const { readOnlyOnWhiteboardLoad, showSmallestScreenIndicator, performance } = common;
|
||||
const { onWhiteboardLoad, showSmallestScreenIndicator, performance } = common;
|
||||
|
||||
this.#readOnlyOnWhiteboardLoad = readOnlyOnWhiteboardLoad;
|
||||
this.#onWhiteboardLoad = onWhiteboardLoad;
|
||||
this.#showSmallestScreenIndicator = showSmallestScreenIndicator;
|
||||
this.#refreshInfoInterval = 1000 / performance.refreshInfoFreq;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user