From 4546a2f88c35de5a070a98d77cf5f6ea7dff75db Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 14 May 2020 14:29:41 -0400 Subject: [PATCH] Set room as read when focusing it by ctrl+tab --- TODO.md | 1 - src/gui/PageLoader.qml | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index d96677dd..dc827dab 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ # TODO -- set open_room correctly when using other ways to change rooms than clicking - merge AccountBar account and RoomList account delegates code - fix python getting stuck when loading large room diff --git a/src/gui/PageLoader.qml b/src/gui/PageLoader.qml index deb89c38..e95967be 100644 --- a/src/gui/PageLoader.qml +++ b/src/gui/PageLoader.qml @@ -50,6 +50,9 @@ HLoader { if (history.length > historyLength) history.pop() pageLoader.setSource(componentUrl, properties) + + if (componentUrl === "Pages/Chat/Chat.qml" && properties.roomId) + py.callCoro("room_read", [properties.roomId]) } function showPage(name, properties={}) { @@ -64,8 +67,6 @@ HLoader { function showRoom(userId, roomId) { _show("Pages/Chat/Chat.qml", {userId, roomId}) - py.callCoro("room_read", [roomId]) - window.uiState.page = "Pages/Chat/Chat.qml" window.uiState.pageProperties = {userId, roomId} window.uiStateChanged()