This commit is contained in:
naielv
2025-08-14 17:18:38 +02:00
parent e0470d0dd1
commit 138af3a364
4 changed files with 12 additions and 23 deletions

View File

@@ -35,23 +35,9 @@ if (urlParams.get("login") != null) {
} }
function open_page(params) { function open_page(params) {
try { EventListenrea.GunJS.forEach(ev => ev.off());
if (EVENTLISTENER != null) { EventListenrea.Timeout.forEach(ev => clearTimeout(ev));
try { EventListenrea.Interval.forEach(ev => clearInterval(ev));
EVENTLISTENER.off();
EVENTLISTENER = null;
EVENTLISTENER2.off();
EVENTLISTENER2 = null;
// TypeError: Cannot read properties of null (reading 'off')
} catch (error) {
if (!error.name == "TypeError") {
console.debug("EVENTLISTENER error", error);
}
}
}
} catch (e) {
console.debug("EVENTLISTENER onhashchange", e);
}
if (SUB_LOGGED_IN != true) { if (SUB_LOGGED_IN != true) {
PAGES["login"].index(); PAGES["login"].index();
return; return;

View File

@@ -967,8 +967,7 @@ function TS_IndexElement(
}); });
} }
ref.map().on((data, key, _msg, _ev) => { ref.map().on((data, key, _msg, _ev) => {
EVENTLISTENER = _ev; EventListeners.GunJS.append(_ev);
function add_row(data, key) { function add_row(data, key) {
if (data != null) { if (data != null) {
data["_key"] = key; data["_key"] = key;

View File

@@ -1,5 +1,8 @@
var EVENTLISTENER = null; var EventListeners = {
var EVENTLISTENER2 = null; GunJS: [],
Timeout: [],
Interval: [],
}
var urlParams = new URLSearchParams(location.search); var urlParams = new URLSearchParams(location.search);
var AC_BYPASS = false; var AC_BYPASS = false;
if (urlParams.get("ac_bypass") == "yes") { if (urlParams.get("ac_bypass") == "yes") {
@@ -28,7 +31,7 @@ if (urlParams.get("sublogin") != null) {
SUB_LOGGED_IN = true; SUB_LOGGED_IN = true;
SUB_LOGGED_IN_ID = urlParams.get("sublogin"); SUB_LOGGED_IN_ID = urlParams.get("sublogin");
SUB_LOGGED_IN_DETAILS = true; SUB_LOGGED_IN_DETAILS = true;
setTimeout(() => { setInterval(() => {
SUB_LOGGED_IN_DETAILS = SC_Personas[SUB_LOGGED_IN_ID]; SUB_LOGGED_IN_DETAILS = SC_Personas[SUB_LOGGED_IN_ID];
}, 1500); }, 1500);
} }

View File

@@ -143,11 +143,12 @@ PAGES.supercafe = {
if (urlParams.get("sc_nobtn") == "yes") { if (urlParams.get("sc_nobtn") == "yes") {
sc_nobtn = "pointer-events: none; opacity: 0.5"; sc_nobtn = "pointer-events: none; opacity: 0.5";
} }
setTimeout(() => { var ev = setTimeout(() => {
tts = true; tts = true;
console.log("TTS Enabled"); console.log("TTS Enabled");
toastr.info("Texto a voz disponible"); toastr.info("Texto a voz disponible");
}, 6500); }, 6500);
EventListeners.Timeout.append(ev)
const tablebody = safeuuid(); const tablebody = safeuuid();
const tablebody2 = safeuuid(); const tablebody2 = safeuuid();
var btn_new = safeuuid(); var btn_new = safeuuid();