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
This commit is contained in:
Carl Schwan
2021-01-08 21:35:37 +01:00
parent e7d8c4b69c
commit 06fd8630d9

View File

@@ -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();