From 77d62b2c72a1d9ffc4887f061378741ae632cec3 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 4 Jan 2023 10:24:04 +0100 Subject: [PATCH] Avoid the "Failed to load messages" popup when all messages have been loaded --- .../Timeline/TimelineController/RoomTimelineController.swift | 5 ++++- changelog.d/pr-399.bugfix | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog.d/pr-399.bugfix diff --git a/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift b/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift index ac0f1dca8..00959eaf4 100644 --- a/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift +++ b/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift @@ -82,7 +82,10 @@ class RoomTimelineController: RoomTimelineControllerProtocol { switch await timelineProvider.paginateBackwards(count) { case .success: return .success(()) - case .failure: + case .failure(let error): + if error == .noMoreMessagesToBackPaginate { + return .success(()) + } return .failure(.generic) } } diff --git a/changelog.d/pr-399.bugfix b/changelog.d/pr-399.bugfix new file mode 100644 index 000000000..e55ce594a --- /dev/null +++ b/changelog.d/pr-399.bugfix @@ -0,0 +1 @@ +Avoid the "Failed to load messages" popup when all messages have been loaded. \ No newline at end of file