fix: crash on chatmessages when using 5.15.2

This commit is contained in:
Richard Ramos 2021-07-08 11:20:03 -04:00 committed by Iuri Matias
parent 2716abf096
commit 8d7a78389d
1 changed files with 10 additions and 6 deletions

View File

@ -19,7 +19,7 @@ SplitView {
id: svRoot
property alias chatLogView: chatLogView
property alias scrollToMessage: chatLogView.scrollToMessage
property var messageList: MessagesData {}
property bool loadingMessages: false
property real scrollY: chatLogView.visibleArea.yPosition * chatLogView.contentHeight
@ -33,12 +33,12 @@ SplitView {
ScrollView {
id: root
contentItem: chatLogView
SplitView.fillWidth: true
SplitView.minimumWidth: 200
height: parent.height
ScrollBar.vertical.policy: chatLogView.contentHeight > chatLogView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
@ -178,6 +178,14 @@ SplitView {
return true
}
Connections {
target: chatsModel
onAppReady: {
chatLogView.scrollToBottom(true)
}
}
Connections {
target: chatsModel.messageView
onMessagesLoaded: {
@ -198,10 +206,6 @@ SplitView {
}
}
onAppReady: {
chatLogView.scrollToBottom(true)
}
onMessageNotificationPushed: function(chatId, msg, messageType, chatType, timestamp, identicon, username, hasMention, isAddedContact, channelName) {
if (messageType == Constants.editType) return;
if (appSettings.notificationSetting == Constants.notifyAllMessages ||