Fix Space Saving

This handles the following non-functioning cases from the space saving mr:
- Selecting home or friends
- Switching space that has the same room selected
This commit is contained in:
James Graham
2024-02-18 10:24:30 +00:00
parent b598584aea
commit fcf64a7e1b
3 changed files with 56 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ QQC2.Control {
}
}
property bool showDirectChats: false
property bool showDirectChats: RoomManager.directChatsActive
signal selectionChanged
signal spacesUpdated
@@ -103,7 +103,9 @@ QQC2.Control {
checked: root.selectedSpaceId === "" && root.showDirectChats === false
onClicked: {
root.showDirectChats = false;
RoomManager.directChatsActive = false;
root.selectedSpaceId = "";
RoomManager.lastSpaceId = "";
root.selectionChanged();
}
}
@@ -123,7 +125,9 @@ QQC2.Control {
checked: root.showDirectChats === true
onClicked: {
root.showDirectChats = true;
RoomManager.directChatsActive = true;
root.selectedSpaceId = "";
RoomManager.lastSpaceId = "";
root.selectionChanged();
}
@@ -184,8 +188,11 @@ QQC2.Control {
onSelected: {
root.showDirectChats = false;
RoomManager.directChatsActive = false;
if (!SpaceHierarchyCache.isSpaceChild(roomId, RoomManager.currentRoom.id) || root.selectedSpaceId == roomId) {
RoomManager.resolveResource(currentRoom.id);
} else {
RoomManager.lastSpaceId = currentRoom.id;
}
root.selectedSpaceId = roomId;
root.selectionChanged();