diff --git a/src/controller.cpp b/src/controller.cpp index e279090eb..223abd1f5 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -261,9 +261,9 @@ void Controller::invokeLogin() auto accessToken = loadAccessTokenFromKeyChain(account); auto c = new Connection(account.homeserver(), this); + addConnection(c); connect(c, &Connection::connected, this, [=] { c->loadState(); - addConnection(c); }); connect(c, &Connection::loginError, this, [=](const QString &error, const QString &) { if (error == "Unrecognised access token") {