From 50ffda05d2fad5222ae0d406d08c472d74d48e79 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sun, 22 Nov 2020 23:10:06 +0100 Subject: [PATCH] Make it possible to cancel "Add account" flow when an account already exists --- imports/NeoChat/Page/LoginPage.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/imports/NeoChat/Page/LoginPage.qml b/imports/NeoChat/Page/LoginPage.qml index 01aa42b73..cb213ac08 100644 --- a/imports/NeoChat/Page/LoginPage.qml +++ b/imports/NeoChat/Page/LoginPage.qml @@ -57,9 +57,18 @@ Kirigami.ScrollablePage { Kirigami.FormData.label: i18n("Device Name (Optional)") onAccepted: doLogin() } - QQC2.Button { - text: i18n("Login") - onClicked: doLogin() + RowLayout { + QQC2.Button { + visible: Controller.accountCount > 0 + text: i18n("Cancel") + onClicked: { + pageStack.layers.clear(); + } + } + QQC2.Button { + text: i18n("Login") + onClicked: doLogin() + } } Connections {