From 106744c7d82d606f8163d8c05c7b55d44b349e80 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 12 Apr 2020 18:38:41 +0200 Subject: [PATCH] Add property to window --- assets/js/components/calls/controller.js | 2 +- assets/js/components/calls/window.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/js/components/calls/controller.js b/assets/js/components/calls/controller.js index 8cbd0c63..cfb3f4cb 100644 --- a/assets/js/components/calls/controller.js +++ b/assets/js/components/calls/controller.js @@ -17,7 +17,7 @@ class CallsController { * @param {Conversation} conv Information about the target conversation */ static Open(conv) { - if(OpenCalls.has(conv.ID) && OpenCalls.get(conv.ID).rootEl.isConnected) + if(OpenCalls.has(conv.ID) && OpenCalls.get(conv.ID).isOpen) return; console.info("Open call for conversation " + conv.ID); diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index aa85917c..e1b88ff8 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -119,6 +119,15 @@ class CallWindow extends CustomEvents { } } + /** + * Check if this conversation window is open or not + * + * @returns {boolean} + */ + get isOpen() { + return this.rootEl.isConnected + } + /** * Make the call window draggable */