Prevent FOUC
3 files changed, 13 insertions, 0 deletions
diff --git a/include/ChatPage.h b/include/ChatPage.h
index f64d9589..0a6d303b 100644
--- a/include/ChatPage.h
+++ b/include/ChatPage.h
@@ -96,6 +96,7 @@ private:
TextInputWidget *text_input_;
TypingDisplay *typingDisplay_;
+ QTimer *consensusTimer_;
QTimer *sync_timer_;
int sync_interval_;
diff --git a/include/TimelineView.h b/include/TimelineView.h
index 4b5a2f77..9b81485d 100644
--- a/include/TimelineView.h
+++ b/include/TimelineView.h
@@ -97,6 +97,9 @@ public slots:
// Add old events at the top of the timeline.
void addBackwardsEvents(const QString &room_id, const RoomMessages &msgs);
+ // Whether or not the initial batch has been loaded.
+ bool hasLoaded();
+
signals:
void updateLastTimelineMessage(const QString &user, const DescInfo &info);
@@ -163,3 +166,9 @@ TimelineView::isDuplicate(const QString &event_id)
{
return eventIds_.contains(event_id);
}
+
+inline bool
+TimelineView::hasLoaded()
+{
+ return scroll_layout_->count() > 1 || isTimelineFinished;
+}
diff --git a/include/TimelineViewManager.h b/include/TimelineViewManager.h
index 35dcac5a..91fda996 100644
--- a/include/TimelineViewManager.h
+++ b/include/TimelineViewManager.h
@@ -47,6 +47,9 @@ public:
void sync(const Rooms &rooms);
void clearAll();
+ // Check if all the timelines have been loaded.
+ bool hasLoaded() const;
+
static QString chooseRandomColor();
static QString displayName(const QString &userid);
|