From 96dcbdde22c06f53e713c1e3df7f4e15eaf725a3 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 1 Nov 2020 05:13:55 +0200 Subject: [PATCH] Don't animate ChatPage transition when notification is tapped And simplified unrolling of the page stack. --- qml/pages/OverviewPage.qml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/qml/pages/OverviewPage.qml b/qml/pages/OverviewPage.qml index cda297f..319b98e 100644 --- a/qml/pages/OverviewPage.qml +++ b/qml/pages/OverviewPage.qml @@ -48,10 +48,8 @@ Page { onPleaseOpenMessage: { console.log("[OverviewPage] Opening chat from external call...") if (chatListCreated) { - if (status !== PageStatus.Active) { - pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ), PageStackAction.Immediate); - } - pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : tdLibWrapper.getChat(chatId) }); + pageStack.pop(overviewPage, PageStackAction.Immediate) + pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : tdLibWrapper.getChat(chatId) }, PageStackAction.Immediate) } } } @@ -154,9 +152,7 @@ Page { } onChatReceived: { if(chat["@extra"] === "openDirectly") { - if (status !== PageStatus.Active) { - pageStack.pop(pageStack.find( function(page){ return(page._depth === 0)} ), PageStackAction.Immediate); - } + pageStack.pop(overviewPage, PageStackAction.Immediate) // if we get a new chat (no messages?), we can not use the provided data pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : tdLibWrapper.getChat(chat.id) }); } @@ -277,13 +273,7 @@ Page { size: BusyIndicatorSize.Large } } - - } - - } - } - }