diff options
author | crupest <crupest@outlook.com> | 2020-08-08 22:17:36 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-08-08 22:17:36 +0800 |
commit | 7d0588219c554f837300e616e226941c723fe937 (patch) | |
tree | 344908df27f42844a27732ee9de7e640ac1c5cee /Timeline/ClientApp/src | |
parent | 5d9107714565e92cbf23f2933a3e7e07a6086b46 (diff) | |
download | timeline-7d0588219c554f837300e616e226941c723fe937.tar.gz timeline-7d0588219c554f837300e616e226941c723fe937.tar.bz2 timeline-7d0588219c554f837300e616e226941c723fe937.zip |
...
Diffstat (limited to 'Timeline/ClientApp/src')
-rw-r--r-- | Timeline/ClientApp/src/app/data/timeline.ts | 11 |
1 files changed, 5 insertions, 6 deletions
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;
}
}
}
|