From 7a16e05b14c7dea173371228ebcfcabce7f5bada Mon Sep 17 00:00:00 2001
From: Konstantinos Sideris <sideris.konstantin@gmail.com>
Date: Sun, 22 Apr 2018 10:54:52 +0300
Subject: [PATCH] Initialize views before room list

---
 src/ChatPage.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ChatPage.cc b/src/ChatPage.cc
index 280ae399a..ff59471f8 100644
--- a/src/ChatPage.cc
+++ b/src/ChatPage.cc
@@ -550,6 +550,7 @@ ChatPage::initialSyncCompleted(const mtx::responses::Sync &response)
         QtConcurrent::run([this, res = std::move(response)]() {
                 try {
                         cache_->saveState(res);
+                        emit initializeViews(std::move(res.rooms));
                         emit initializeRoomList(cache_->roomInfo());
                 } catch (const lmdb::error &e) {
                         qWarning() << "cache error:" << QString::fromStdString(e.what());
@@ -557,7 +558,6 @@ ChatPage::initialSyncCompleted(const mtx::responses::Sync &response)
                         return;
                 }
 
-                emit initializeViews(std::move(res.rooms));
                 emit continueSync(cache_->nextBatchToken());
                 emit contentLoaded();
         });
-- 
GitLab