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()