diff --git a/src/qml/RoomListPage.qml b/src/qml/RoomListPage.qml index 366728b72..64545f5a2 100644 --- a/src/qml/RoomListPage.qml +++ b/src/qml/RoomListPage.qml @@ -32,6 +32,7 @@ Kirigami.Page { readonly property RoomListModel roomListModel: RoomListModel { connection: root.connection } + property bool spaceChanging: false readonly property bool collapsed: Config.collapsed @@ -106,6 +107,7 @@ Kirigami.Page { connection: root.connection + onSelectionChanged: root.spaceChanging = true; onSpacesUpdated: sortFilterRoomListModel.invalidate() } @@ -218,9 +220,10 @@ Kirigami.Page { // in this case activeSpaceId followed by mode. Timer { id: layoutTimer - interval: 100 - onTriggered: if (spaceDrawer.showDirectChats || spaceDrawer.selectedSpaceId.length < 1) { - RoomManager.resolveResource(listView.itemAtIndex(0).currentRoom.id) + interval: 300 + onTriggered: if ((spaceDrawer.showDirectChats || spaceDrawer.selectedSpaceId.length < 1) && root.spaceChanging) { + RoomManager.resolveResource(listView.itemAtIndex(0).currentRoom.id); + root.spaceChanging = false; } } diff --git a/src/qml/SpaceDrawer.qml b/src/qml/SpaceDrawer.qml index 93c494450..8f044db57 100644 --- a/src/qml/SpaceDrawer.qml +++ b/src/qml/SpaceDrawer.qml @@ -25,6 +25,7 @@ QQC2.Control { property bool showDirectChats: false + signal selectionChanged() signal spacesUpdated() contentItem: Loader { @@ -94,6 +95,7 @@ QQC2.Control { onClicked: { root.showDirectChats = false root.selectedSpaceId = "" + root.selectionChanged() } } AvatarTabButton { @@ -113,6 +115,7 @@ QQC2.Control { onClicked: { root.showDirectChats = true root.selectedSpaceId = "" + root.selectionChanged() } QQC2.Label { @@ -176,6 +179,7 @@ QQC2.Control { RoomManager.resolveResource(currentRoom.id) } root.selectedSpaceId = roomId + root.selectionChanged() } checked: root.selectedSpaceId === roomId onContextMenuRequested: root.createContextMenu(currentRoom)