From 729235fe6a7758705e44a8ed8bbf7b61272cd7f4 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 16 Aug 2019 01:31:46 -0400 Subject: [PATCH] When a room is left, set UI state to default page --- src/qml/Chat/Chat.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qml/Chat/Chat.qml b/src/qml/Chat/Chat.qml index 981aeea7..41c5d816 100644 --- a/src/qml/Chat/Chat.qml +++ b/src/qml/Chat/Chat.qml @@ -18,6 +18,14 @@ HPage { readonly property var roomInfo: Utils.getItem( modelSources[["Room", userId]] || [], "room_id", roomId ) || "waiting" + onRoomInfoChanged: { + if (roomInfo.left) { + // The room will most likely be gone on client restart + window.uiState.page = "Pages/Default.qml" + window.uiState.pageProperties = {} + window.uiStateChanged() + } + } readonly property bool hasUnknownDevices: false