Only allow one window per conversation

This commit is contained in:
Pierre HUBERT 2019-02-23 18:36:40 +01:00
parent 0f4d3042c3
commit bbaaf3a5c2
2 changed files with 13 additions and 0 deletions

View File

@ -142,6 +142,10 @@ ComunicWeb.components.calls.controller = {
*/
open: function(call){
//Check if the call is already in the list of calls
if(ComunicWeb.components.calls.currentList.isCallInList(call.id))
return;
//Add the call to the list of opened calls
ComunicWeb.components.calls.currentList.addCallToList(call.id);

View File

@ -27,6 +27,15 @@ ComunicWeb.components.calls.currentList = {
return string.split(",");
},
/**
* Check if a call ID is in the list of opened calls
*
* @param {Number} id The ID of the call to check
*/
isCallInList: function(id){
return this.getCurrentCallsList().includes(""+id);
},
/**
* Save a new list of calls
*