mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Update prev_batch only while paginating
This commit is contained in:
parent
0368d854cf
commit
c060a136a9
2 changed files with 5 additions and 1 deletions
|
@ -110,6 +110,7 @@ private:
|
||||||
bool isPaginationInProgress_ = false;
|
bool isPaginationInProgress_ = false;
|
||||||
bool isInitialized = false;
|
bool isInitialized = false;
|
||||||
bool isTimelineFinished = false;
|
bool isTimelineFinished = false;
|
||||||
|
bool isInitialSync = true;
|
||||||
|
|
||||||
const int SCROLL_BAR_GAP = 300;
|
const int SCROLL_BAR_GAP = 300;
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,10 @@ int TimelineView::addEvents(const Timeline &timeline)
|
||||||
{
|
{
|
||||||
int message_count = 0;
|
int message_count = 0;
|
||||||
|
|
||||||
prev_batch_token_ = timeline.previousBatch();
|
if (isInitialSync) {
|
||||||
|
prev_batch_token_ = timeline.previousBatch();
|
||||||
|
isInitialSync = false;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &event : timeline.events()) {
|
for (const auto &event : timeline.events()) {
|
||||||
TimelineItem *item = parseMessageEvent(event.toObject(), TimelineDirection::Bottom);
|
TimelineItem *item = parseMessageEvent(event.toObject(), TimelineDirection::Bottom);
|
||||||
|
|
Loading…
Reference in a new issue