From 2e0096380f6e4fd526d63cd278d1cf0bd808fda1 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 8 Jan 2021 21:35:37 +0100 Subject: [PATCH] Fix NeoChat not syncing This problem was caused because addConnection was starting the sync proccess unfortunally because the user wasn't connected this aborted almost immediately and then the sync proccess wouldn't run at all. Now start the sync proccess after making sure we are connected. Fix #228 --- src/controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controller.cpp b/src/controller.cpp index e80879da2..9b0321b78 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -269,9 +269,9 @@ void Controller::invokeLogin() auto accessToken = loadAccessTokenFromKeyChain(account); auto connection = new Connection(account.homeserver(), this); - addConnection(connection); connect(connection, &Connection::connected, this, [=] { connection->loadState(); + addConnection(connection); if (connection->userId() == id) { setActiveConnection(connection); Q_EMIT initiated();