fix config not saving with broken listeners, fix cursor ReferenceError
This commit is contained in:
parent
6db35b2f99
commit
ed86aff2a2
3 changed files with 9 additions and 12 deletions
|
@ -55,6 +55,7 @@ class Config {
|
|||
get crt() { return this._crt }
|
||||
set crt(/** @type boolean */ enabled) {
|
||||
this._crt = enabled;
|
||||
this.save();
|
||||
|
||||
if (enabled) {
|
||||
document.body.classList.add("crt");
|
||||
|
@ -66,26 +67,24 @@ class Config {
|
|||
this.#listeners.get('crt').forEach(callback => {
|
||||
callback(this._crt);
|
||||
})
|
||||
|
||||
this.save();
|
||||
}
|
||||
|
||||
get cursor() { return this._cursor }
|
||||
set cursor(/** @type boolean */ value) {
|
||||
this._cursor = value;
|
||||
this.save();
|
||||
this.#listeners.get('cursor').forEach(callback => {
|
||||
callback(this._cursor);
|
||||
})
|
||||
this.save();
|
||||
}
|
||||
|
||||
get cursorFunMode() { return this._cursorFunMode }
|
||||
set cursorFunMode(/** @type boolean */ value) {
|
||||
this._cursorFunMode = value;
|
||||
this.save();
|
||||
this.#listeners.get('cursorFunMode').forEach(callback => {
|
||||
callback(this._cursorFunMode);
|
||||
})
|
||||
this.save();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ function cursorSetup() {
|
|||
|
||||
switch (args[0]) {
|
||||
case 'id': {
|
||||
myCursor.id = Number(args[1]);
|
||||
myCursor.id = id;
|
||||
break;
|
||||
}
|
||||
case 'join': {
|
||||
|
@ -385,8 +385,6 @@ function cursorDestroy() {
|
|||
cursors.clear();
|
||||
myCursor = null;
|
||||
|
||||
cursorContainer.remove();
|
||||
|
||||
console.log(`Cursor no longer tracking.`);
|
||||
running = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue