From 318ae67c17f3e64532bad23c2a61a93446db553d Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 30 May 2021 00:00:00 +0300 Subject: Open selected account when application is started --- qml/main.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qml') diff --git a/qml/main.qml b/qml/main.qml index c689196..a6cc6f1 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -54,6 +54,16 @@ Kirigami.ApplicationWindow { console.log('starting') eventEmitter = dcAccounts.getEventEmitter() eventEmitter.start(); + + // Open selected account if there is one. + let selectedAccount = dcAccounts.getSelectedAccount(); + if (selectedAccount) { + if (selectedAccount.isConfigured()) { + pageStack.replace("qrc:/qml/ChatlistPage.qml", {context: selectedAccount, eventEmitter: eventEmitter}) + } else { + pageStack.replace("qrc:/qml/ConfigurePage.qml", {context: selectedAccount, eventEmitter: eventEmitter}) + } + } } onClosing: { -- cgit v1.2.3-70-g09d2