From 1f35b02326e81b993afcb906b34ca9a948c0d842 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 25 Apr 2020 18:39:01 +0200 Subject: [PATCH] Simplify code --- assets/js/components/conversations/chatWindows.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 7d9b059f..3cbcb773 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -544,15 +544,14 @@ const ConvChatWindow = { if(conversation.infos.name) settingsForm.conversationNameInput.value = conversation.infos.name; - //Check if user is a conversation moderator or not - if(conversation.infos.ID_owner == userID()){ - //Update conversation members - ComunicWeb.components.userSelect.pushEntries(settingsForm.usersElement, conversation.infos.members); + //Update conversation members + ComunicWeb.components.userSelect.pushEntries(settingsForm.usersElement, conversation.infos.members); - // Update checkbox to allow or not everyone to add members - $(settingsForm.allowEveryoneToAddMembers).iCheck(conversation.infos.canEveryoneAddMembers ? "check" : "uncheck"); - } - else { + // Update checkbox to allow or not everyone to add members + $(settingsForm.allowEveryoneToAddMembers).iCheck(conversation.infos.canEveryoneAddMembers ? "check" : "uncheck"); + + //Check if user is a conversation moderator or not + if(conversation.infos.ID_owner != userID()) { //We disable name field settingsForm.conversationNameInput.disabled = "true";