Fix errors when conversation has no chat room.

This commit is contained in:
Julien Wadel 2022-09-22 10:14:54 +02:00
parent f7eee0444c
commit 308c3c8248

View file

@ -624,9 +624,9 @@ ColumnLayout {
proxyModel: ChatRoomProxyModel {
id: chatRoomProxyModel
Component.onCompleted: {
if ( (!chatRoomModel.haveEncryption && !SettingsModel.standardChatEnabled)
|| (chatRoomModel.haveEncryption && !SettingsModel.secureChatEnabled) ) {
function updateFilter(){
if ( chatRoomModel && ((!chatRoomModel.haveEncryption && !SettingsModel.standardChatEnabled)
|| (chatRoomModel.haveEncryption && !SettingsModel.secureChatEnabled)) ) {
setEntryTypeFilter(ChatRoomModel.CallEntry)
}
}
@ -635,6 +635,11 @@ ColumnLayout {
fullPeerAddress: conversation.fullPeerAddress
fullLocalAddress: conversation.fullLocalAddress
localAddress: conversation.localAddress// Reload is done on localAddress. Use this order
onChatRoomModelChanged: updateFilter()
Component.onCompleted: {
updateFilter()
}
}
}