mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Avoid the presence of multiple phone buttons
This commit is contained in:
		@@ -799,6 +799,11 @@ const ConvChatWindow = {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	showCallButton: function(conversation){
 | 
						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
 | 
							//Check if calls are disabled
 | 
				
			||||||
		if(!conversation.infos.can_have_call)
 | 
							if(!conversation.infos.can_have_call)
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
@@ -807,7 +812,7 @@ const ConvChatWindow = {
 | 
				
			|||||||
		const button = createElem2({
 | 
							const button = createElem2({
 | 
				
			||||||
			insertBefore: conversation.box.boxTools.firstChild,
 | 
								insertBefore: conversation.box.boxTools.firstChild,
 | 
				
			||||||
			type: "button",
 | 
								type: "button",
 | 
				
			||||||
			class: "btn btn-box-tool",
 | 
								class: "btn btn-box-tool phone-button",
 | 
				
			||||||
			innerHTML: "<i class='fa fa-phone'></i>"
 | 
								innerHTML: "<i class='fa fa-phone'></i>"
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		conversation.box.callButton = button;
 | 
							conversation.box.callButton = button;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user