aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-08 22:17:36 +0800
committercrupest <crupest@outlook.com>2020-08-08 22:17:36 +0800
commit7ca82884fa122d247cda484c65686edd01b7fc46 (patch)
treec672d14bac64f7fd1216beefa1fff5dd5654c74a /Timeline/ClientApp
parent8f340ef369d12b03563d5b61d5a8c4dd504a97db (diff)
downloadtimeline-7ca82884fa122d247cda484c65686edd01b7fc46.tar.gz
timeline-7ca82884fa122d247cda484c65686edd01b7fc46.tar.bz2
timeline-7ca82884fa122d247cda484c65686edd01b7fc46.zip
...
Diffstat (limited to 'Timeline/ClientApp')
-rw-r--r--Timeline/ClientApp/src/app/data/timeline.ts11
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;
}
}
}