aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/services/timeline.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-12 21:54:17 +0800
committercrupest <crupest@outlook.com>2021-01-12 21:54:17 +0800
commit11724294f107b23c68b0718530262664ea5e0efc (patch)
tree04cf369ee7539d24f85d13f1f79390c97e0a92a1 /FrontEnd/src/app/services/timeline.ts
parenta027917a6be844cf13e9980a4d209f1b6d56e112 (diff)
downloadtimeline-11724294f107b23c68b0718530262664ea5e0efc.tar.gz
timeline-11724294f107b23c68b0718530262664ea5e0efc.tar.bz2
timeline-11724294f107b23c68b0718530262664ea5e0efc.zip
...
Diffstat (limited to 'FrontEnd/src/app/services/timeline.ts')
-rw-r--r--FrontEnd/src/app/services/timeline.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/FrontEnd/src/app/services/timeline.ts b/FrontEnd/src/app/services/timeline.ts
index 8bc1d40b..7d239fbf 100644
--- a/FrontEnd/src/app/services/timeline.ts
+++ b/FrontEnd/src/app/services/timeline.ts
@@ -104,8 +104,9 @@ export class TimelineService {
saveData: async (timelineName, data) => {
if (data === "notexist") return;
- userInfoService.saveUser(data.owner);
- userInfoService.saveUsers(data.members);
+ // TODO: Avoid save same user.
+ void userInfoService.saveUser(data.owner);
+ void userInfoService.saveUsers(data.members);
await dataStorage.setItem<TimelineData>(
this.generateTimelineDataStorageKey(timelineName),
@@ -157,8 +158,8 @@ export class TimelineService {
},
});
- syncTimeline(timelineName: string): void {
- this.timelineHub.getLine(timelineName).sync();
+ syncTimeline(timelineName: string): Promise<void> {
+ return this.timelineHub.getLine(timelineName).sync();
}
createTimeline(timelineName: string): Observable<TimelineInfo> {
@@ -222,7 +223,7 @@ export class TimelineService {
};
data.posts.forEach((p) => {
- userInfoService.saveUser(p.author);
+ void userInfoService.saveUser(p.author);
});
await dataStorage.setItem<TimelinePostsData>(
@@ -342,8 +343,8 @@ export class TimelineService {
},
});
- syncPosts(timelineName: string): void {
- this.postsHub.getLine(timelineName).sync();
+ syncPosts(timelineName: string): Promise<void> {
+ return this.postsHub.getLine(timelineName).sync();
}
createPost(
@@ -354,7 +355,7 @@ export class TimelineService {
getHttpTimelineClient()
.postPost(timelineName, request)
.then(() => {
- this.syncPosts(timelineName);
+ void this.syncPosts(timelineName);
})
);
}
@@ -364,7 +365,7 @@ export class TimelineService {
getHttpTimelineClient()
.deletePost(timelineName, postId)
.then(() => {
- this.syncPosts(timelineName);
+ void this.syncPosts(timelineName);
})
);
}