rename vars

This commit is contained in:
raphael 2021-06-17 08:35:04 +02:00
parent 26b4bbc2a2
commit 334f8c8f38

View File

@ -6,7 +6,7 @@ class ReadOnlyBackendService {
* @type {Map<string, string>} * @type {Map<string, string>}
* @private * @private
*/ */
#idToReadOnlyId = new Map(); _idToReadOnlyId = new Map();
/** /**
* Mapping from a read-only whiteboard id to the matching editable whiteboard id * Mapping from a read-only whiteboard id to the matching editable whiteboard id
@ -14,7 +14,7 @@ class ReadOnlyBackendService {
* @type {Map<string, string>} * @type {Map<string, string>}
* @private * @private
*/ */
#readOnlyIdToId = new Map(); _readOnlyIdToId = new Map();
/** /**
* Make sure a whiteboardId is ignited in the service * Make sure a whiteboardId is ignited in the service
@ -24,8 +24,8 @@ class ReadOnlyBackendService {
* @param {string} whiteboardId * @param {string} whiteboardId
*/ */
init(whiteboardId) { init(whiteboardId) {
const idToReadOnlyId = this.#idToReadOnlyId; const idToReadOnlyId = this._idToReadOnlyId;
const readOnlyIdToId = this.#readOnlyIdToId; const readOnlyIdToId = this._readOnlyIdToId;
if (!idToReadOnlyId.has(whiteboardId) && !readOnlyIdToId.has(whiteboardId)) { if (!idToReadOnlyId.has(whiteboardId) && !readOnlyIdToId.has(whiteboardId)) {
const readOnlyId = uuidv4(); const readOnlyId = uuidv4();
@ -45,7 +45,7 @@ class ReadOnlyBackendService {
if (this.isReadOnly(whiteboardId)) return whiteboardId; if (this.isReadOnly(whiteboardId)) return whiteboardId;
// run in isReadOnly // run in isReadOnly
// this.init(whiteboardId); // this.init(whiteboardId);
return this.#idToReadOnlyId.get(whiteboardId); return this._idToReadOnlyId.get(whiteboardId);
} }
/** /**
@ -55,7 +55,7 @@ class ReadOnlyBackendService {
* @return {string} * @return {string}
*/ */
getIdFromReadOnlyId(readOnlyId) { getIdFromReadOnlyId(readOnlyId) {
return this.#readOnlyIdToId.get(readOnlyId); return this._readOnlyIdToId.get(readOnlyId);
} }
/** /**
@ -66,7 +66,7 @@ class ReadOnlyBackendService {
*/ */
isReadOnly(whiteboardId) { isReadOnly(whiteboardId) {
this.init(whiteboardId); this.init(whiteboardId);
return this.#readOnlyIdToId.has(whiteboardId); return this._readOnlyIdToId.has(whiteboardId);
} }
} }