diff --git a/assets/js/components/calls/controller.js b/assets/js/components/calls/controller.js index 827de2ee..54fa8d44 100644 --- a/assets/js/components/calls/controller.js +++ b/assets/js/components/calls/controller.js @@ -80,7 +80,7 @@ document.addEventListener("wsClosed", () => { // Close all the current conversations OpenConversations.forEach((v) => v.Close(false)) - OpenConversations = new Map(); + OpenConversations.clear(); }) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index 974096ba..d3f9da01 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -148,9 +148,10 @@ class CallWindow extends CustomEvents { this.rootEl.remove(); // Leave the call - await ws("calls/leave", { - convID: this.conv.ID - }) + if(UserWebSocket.IsConnected) + await ws("calls/leave", { + convID: this.conv.ID + }) if(propagate) this.emitEvent("close");