From 7eff952b6b100eb02311f1d46b221980e3761eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 22 Apr 2022 13:53:57 +0200 Subject: [PATCH] MOBILE-3881 timeline: Concatenate loaded more events --- src/addons/block/timeline/components/events/events.ts | 1 + src/addons/block/timeline/components/timeline/timeline.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/addons/block/timeline/components/events/events.ts b/src/addons/block/timeline/components/events/events.ts index 653313e31..bdebff829 100644 --- a/src/addons/block/timeline/components/events/events.ts +++ b/src/addons/block/timeline/components/events/events.ts @@ -76,6 +76,7 @@ export class AddonBlockTimelineEventsComponent implements OnChanges { events: eventsByDay[dayTimestamp], }; }); + this.loadingMore = false; } else { this.empty = true; } diff --git a/src/addons/block/timeline/components/timeline/timeline.ts b/src/addons/block/timeline/components/timeline/timeline.ts index d0602b990..25daa185a 100644 --- a/src/addons/block/timeline/components/timeline/timeline.ts +++ b/src/addons/block/timeline/components/timeline/timeline.ts @@ -164,7 +164,7 @@ export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implemen protected async fetchMyOverviewTimeline(afterEventId?: number): Promise { const events = await AddonBlockTimeline.getActionEventsByTimesort(afterEventId, this.searchText); - this.timeline.events = events.events; + this.timeline.events = afterEventId ? this.timeline.events.concat(events.events) : events.events; this.timeline.canLoadMore = events.canLoadMore; }