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
commit7d0588219c554f837300e616e226941c723fe937 (patch)
tree344908df27f42844a27732ee9de7e640ac1c5cee /Timeline/ClientApp
parent5d9107714565e92cbf23f2933a3e7e07a6086b46 (diff)
downloadtimeline-7d0588219c554f837300e616e226941c723fe937.tar.gz
timeline-7d0588219c554f837300e616e226941c723fe937.tar.bz2
timeline-7d0588219c554f837300e616e226941c723fe937.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;
}
}
}