mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 05:52:41 +00:00
fix(chat): use loader for ChatMessagesView
instead ChatContentView
fixes: #10285
This commit is contained in:
parent
136635670e
commit
ec7bd963e9
@ -135,17 +135,11 @@ Item {
|
||||
id: chatRepeater
|
||||
model: parentModule && parentModule.model
|
||||
|
||||
delegate: Loader {
|
||||
id: chatLoader
|
||||
|
||||
// Channels/chats are not loaded by default and only load when first put active
|
||||
active: model.loaderActive
|
||||
ChatContentView {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: model.active
|
||||
|
||||
sourceComponent: ChatContentView {
|
||||
visible: !root.rootStore.openCreateChat && isActiveChannel
|
||||
visible: model.active && !root.rootStore.openCreateChat && isActiveChannel
|
||||
chatMessagesLoader.active: model.loaderActive
|
||||
rootStore: root.rootStore
|
||||
contactsStore: root.contactsStore
|
||||
emojiPopup: root.emojiPopup
|
||||
@ -156,7 +150,7 @@ Item {
|
||||
stickersLoaded: root.stickersLoaded
|
||||
isBlocked: model.blocked
|
||||
isUserAdded: root.isUserAdded
|
||||
isActiveChannel: chatLoader.visible
|
||||
isActiveChannel: model.active
|
||||
onOpenStickerPackPopup: {
|
||||
root.openStickerPackPopup(stickerPackId)
|
||||
}
|
||||
@ -171,7 +165,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChatRequestMessagePanel {
|
||||
anchors.fill: parent
|
||||
|
@ -36,9 +36,10 @@ ColumnLayout {
|
||||
property var contactsStore
|
||||
property bool isActiveChannel: false
|
||||
|
||||
readonly property alias chatMessagesLoader: chatMessagesLoader
|
||||
|
||||
property var emojiPopup
|
||||
property var stickersPopup
|
||||
property alias textInputField: chatInput
|
||||
property UsersStore usersStore: UsersStore {}
|
||||
|
||||
onChatContentModuleChanged: {
|
||||
@ -76,8 +77,7 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
MessageStore {
|
||||
id: messageStore
|
||||
readonly property var messageStore: MessageStore {
|
||||
messageModule: chatContentModule ? chatContentModule.messagesModule : null
|
||||
chatSectionModule: root.rootStore.chatCommunitySectionModule
|
||||
}
|
||||
@ -137,15 +137,17 @@ ColumnLayout {
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
|
||||
ChatMessagesView {
|
||||
id: chatMessages
|
||||
Loader {
|
||||
id: chatMessagesLoader
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
sourceComponent: ChatMessagesView {
|
||||
chatContentModule: root.chatContentModule
|
||||
rootStore: root.rootStore
|
||||
contactsStore: root.contactsStore
|
||||
messageContextMenu: contextmenu
|
||||
messageStore: messageStore
|
||||
messageStore: root.messageStore
|
||||
emojiPopup: root.emojiPopup
|
||||
stickersPopup: root.stickersPopup
|
||||
usersStore: root.usersStore
|
||||
@ -165,6 +167,7 @@ ColumnLayout {
|
||||
}
|
||||
onEditModeChanged: if (!editModeOn) chatInput.forceInputActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: inputArea
|
||||
|
Loading…
x
Reference in New Issue
Block a user