mirror of
https://github.com/webui-dev/webui.git
synced 2024-09-11 14:06:09 +03:00
Fix WS close warning
This commit is contained in:
parent
67179f582b
commit
0462ca7fdb
File diff suppressed because it is too large
Load Diff
@ -174,10 +174,10 @@ class WebuiBridge {
|
||||
}
|
||||
// Methods
|
||||
#close(reason = 0, value = '') {
|
||||
this.#wsStatus = false;
|
||||
this.#closeReason = reason;
|
||||
this.#closeValue = value;
|
||||
this.#ws.close();
|
||||
if (this.#wsStatus) this.#ws.close();
|
||||
this.#wsStatus = false;
|
||||
if (reason === this.#CMD_NAVIGATION) {
|
||||
if (this.#log) {
|
||||
console.log(`WebUI -> Close -> Navigation to [${value}]`);
|
||||
@ -415,7 +415,7 @@ class WebuiBridge {
|
||||
if (!this.#log) globalThis.close();
|
||||
else {
|
||||
console.log(`WebUI -> CMD -> Close`);
|
||||
this.#ws.close();
|
||||
if (this.#wsStatus) this.#ws.close();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -450,7 +450,7 @@ class WebuiBridge {
|
||||
// let's send a void message to keep WS open
|
||||
this.#sendData(new TextEncoder().encode('ping'));
|
||||
} else {
|
||||
// There is an active communication
|
||||
// There is an active communicationthis.#wsStatus
|
||||
this.#Ping = true;
|
||||
}
|
||||
await new Promise((resolve) => setTimeout(resolve, 20000));
|
||||
|
Loading…
Reference in New Issue
Block a user