From 06fd8630d9f082d01ab67c447d8664a62531a7e1 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 ba83ba8b3..07919d3b7 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();