Fix logout
Fix the account editor setting page and the controller logout function so that you can logout without crashing.
This commit is contained in:
@@ -291,8 +291,11 @@ void Controller::logout(Connection *conn, bool serverSideLogout)
|
|||||||
job.start();
|
job.start();
|
||||||
loop.exec();
|
loop.exec();
|
||||||
|
|
||||||
if (conn == activeConnection() && AccountRegistry::instance().count() > 1) {
|
if (AccountRegistry::instance().count() > 1) {
|
||||||
setActiveConnection(AccountRegistry::instance().accounts()[0]);
|
// Only set the connection if the the account being logged out is currently active
|
||||||
|
if (conn == activeConnection()) {
|
||||||
|
setActiveConnection(AccountRegistry::instance().accounts()[0]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setActiveConnection(nullptr);
|
setActiveConnection(nullptr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ Kirigami.ScrollablePage {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: i18n("Sign out")
|
text: i18n("Sign out")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Controller.logout(model.connection, true);
|
Controller.logout(root.connection, true);
|
||||||
root.closeDialog();
|
root.closeDialog();
|
||||||
if (Controller.accountCount === 1) {
|
if (Controller.accountCount === 1) {
|
||||||
pageStack.layers.pop();
|
pageStack.layers.pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user