From 1d11f78abcff377b21356a85762cb9ef13488d19 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Mon, 28 Oct 2024 17:29:15 +0100 Subject: [PATCH] Don't error timeline on new statuses if there is statuses displayed. --- .../Timeline/Sources/Timeline/View/TimelineViewModel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift b/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift index 7a45dbc2..2f8a6a85 100644 --- a/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift +++ b/Packages/Timeline/Sources/Timeline/View/TimelineViewModel.swift @@ -213,8 +213,8 @@ extension TimelineViewModel: StatusesFetcher { pendingStatusesObserver.isLoadingNewStatuses = !pullToRefresh try await fetchNewPagesFrom(latestStatus: latest.id, client: client) } - } catch let error { - if (error as NSError).code != -999 { + } catch { + if await datasource.isEmpty { statusesState = .error(error: error) } canStreamEvents = true