fix forwarding message #LINQT-1877

This commit is contained in:
Gaelle Braud 2025-08-18 14:23:38 +02:00
parent 93418cb7c9
commit 90ad29c78e
3 changed files with 16 additions and 7 deletions

View file

@ -19,7 +19,7 @@ ListView {
property ChatGui currentChatGui
onCurrentIndexChanged: currentChatGui = model.getAt(currentIndex) || null
onCurrentChatGuiChanged: chatClicked(currentChatGui)
onChatClicked: (chat) => {currentChatGui = chat}
signal resultsReceived()
signal markAllAsRead()

View file

@ -679,7 +679,6 @@ FocusScope {
checkable: true
checked: true
icon.source: checked ? AppIcons.upArrow : AppIcons.downArrow
KeyNavigation.down: contentControl
}
}
ChatListView {
@ -694,7 +693,6 @@ FocusScope {
}
}
AllContactListView {
visible: expandContactButton.checked
Layout.fillWidth: true
itemsRightMargin: 0
showActions: false
@ -703,7 +701,7 @@ FocusScope {
searchBarText: forwardSearchBar.text
Layout.preferredHeight: contentHeight
onContactSelected: contact => selectedFriend = contact
property FriendGui selectedFriend
property FriendGui selectedFriend: null
property var chatForSelectedAddressObj: selectedFriend ? UtilsCpp.getChatForAddress(selectedFriend.core.defaultAddress) : null
property ChatGui chatForAddress: chatForSelectedAddressObj ? chatForSelectedAddressObj.value : null
onChatForAddressChanged: if(chatForAddress) {

View file

@ -187,8 +187,8 @@ AbstractMainPage {
searchBar: searchBar
Control.ScrollBar.vertical: scrollbar
onChatClicked: (chat) => {
mainItem.selectedChatGui = chat
onCurrentChatGuiChanged: {
mainItem.selectedChatGui = currentChatGui
}
Connections {
@ -331,10 +331,21 @@ AbstractMainPage {
id: currentChatComp
FocusScope {
SelectedChatView {
id: selectedChatView
visible: chat != undefined && chat != null
anchors.fill: parent
onChatChanged: if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat
chat: mainItem.selectedChatGui ? mainItem.selectedChatGui : null
onChatChanged: {
if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat
}
// Binding is destroyed when forward message is done so
// we need this connection in addition
Connections {
target: mainItem
function onSelectedChatGuiChanged() {
selectedChatView.chat = mainItem.selectedChatGui
}
}
}
}
}