refactor(ChatContentView): only get contact details when 1-1 chat
This commit is contained in:
parent
0c9b568b95
commit
435b08501b
|
@ -140,6 +140,7 @@ Item {
|
|||
height: parent.height
|
||||
visible: !root.rootStore.openCreateChat && isActiveChannel
|
||||
chatId: model.itemId
|
||||
activeChatType: root.activeChatType
|
||||
chatMessagesLoader.active: model.loaderActive
|
||||
rootStore: root.rootStore
|
||||
contactsStore: root.contactsStore
|
||||
|
|
|
@ -37,6 +37,7 @@ ColumnLayout {
|
|||
property var contactsStore
|
||||
property bool isActiveChannel: false
|
||||
property string chatId
|
||||
property int activeChatType
|
||||
|
||||
readonly property alias chatMessagesLoader: chatMessagesLoader
|
||||
|
||||
|
@ -65,6 +66,9 @@ ColumnLayout {
|
|||
property bool isUserAdded
|
||||
|
||||
function updateIsUserAdded() {
|
||||
if (activeChatType !== Constants.chatType.oneToOne) {
|
||||
return false
|
||||
}
|
||||
isUserAdded = Qt.binding(() => {isActiveChannel; return Utils.getContactDetailsAsJson(root.chatId, false).isAdded})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue