diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 81b13951..2decbaab 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -799,6 +799,11 @@ const ConvChatWindow = { */ showCallButton: function(conversation){ + // Remove previous button (if any) + let previousButton = conversation.box.boxTools.querySelector(".phone-button"); + if(previousButton) + previousButton.remove(); + //Check if calls are disabled if(!conversation.infos.can_have_call) return; @@ -807,7 +812,7 @@ const ConvChatWindow = { const button = createElem2({ insertBefore: conversation.box.boxTools.firstChild, type: "button", - class: "btn btn-box-tool", + class: "btn btn-box-tool phone-button", innerHTML: "" }); conversation.box.callButton = button;