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

View File

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