From 9e5fe2dc856795d0d3d8b6a3adf3fdd3015d9158 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 18 Jul 2021 01:23:09 +0300 Subject: Remove all layers when pressing "Switch account" Otherwise clicking "Switch account" multiple times results in multiple layers stacked. --- qml/main.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qml/main.qml b/qml/main.qml index cd1af50..7a91980 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -37,7 +37,12 @@ Kirigami.ApplicationWindow { Kirigami.Action { text: "Switch account" iconName: "system-switch-user" - onTriggered: pageStack.layers.push(accountsPage) + onTriggered: { + while (pageStack.layers.depth > 1) { + pageStack.layers.pop() + } + pageStack.layers.push(accountsPage) + } } ] } -- cgit v1.2.3-70-g09d2