From 7d0588219c554f837300e616e226941c723fe937 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 8 Aug 2020 22:17:36 +0800 Subject: ... --- Timeline/ClientApp/src/app/data/timeline.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Timeline/ClientApp/src') diff --git a/Timeline/ClientApp/src/app/data/timeline.ts b/Timeline/ClientApp/src/app/data/timeline.ts index d2cfcf9b..495def59 100644 --- a/Timeline/ClientApp/src/app/data/timeline.ts +++ b/Timeline/ClientApp/src/app/data/timeline.ts @@ -154,7 +154,7 @@ export class TimelineService { this._timelineHub .getLine(timelineName) ?.next({ type: 'synced', timeline: null }); - } else if (e instanceof HttpNetworkError) { + } else { const cache = await this.getCachedTimeline(timelineName); if (cache == null) this._timelineHub @@ -164,8 +164,8 @@ export class TimelineService { this._timelineHub .getLine(timelineName) ?.next({ type: 'offline', timeline: cache }); - } else { - throw e; + + if (!(e instanceof HttpNetworkError)) throw e; } } } @@ -336,7 +336,7 @@ export class TimelineService { this._postsHub .getLine(timelineName) ?.next({ type: 'forbid', posts: [] }); - } else if (e instanceof HttpNetworkError) { + } else { const cache = await this.getCachedPosts(timelineName); if (cache == null) this._postsHub @@ -346,8 +346,7 @@ export class TimelineService { this._postsHub .getLine(timelineName) ?.next({ type: 'offline', posts: cache }); - } else { - throw e; + if (!(e instanceof HttpNetworkError)) throw e; } } } -- cgit v1.2.3