aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/pages/timeline/Timeline.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-31 00:08:48 +0800
committercrupest <crupest@outlook.com>2023-07-31 00:09:12 +0800
commitd9c1d512fa64ef4f8c08ca34f7a5842642879bcc (patch)
treee71cd57b30ed67462ecaf010812b6d902c7fa675 /FrontEnd/src/pages/timeline/Timeline.tsx
parent538d6830a0022b49b99695095d85e567b0c86e71 (diff)
downloadtimeline-d9c1d512fa64ef4f8c08ca34f7a5842642879bcc.tar.gz
timeline-d9c1d512fa64ef4f8c08ca34f7a5842642879bcc.tar.bz2
timeline-d9c1d512fa64ef4f8c08ca34f7a5842642879bcc.zip
...
Diffstat (limited to 'FrontEnd/src/pages/timeline/Timeline.tsx')
-rw-r--r--FrontEnd/src/pages/timeline/Timeline.tsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/FrontEnd/src/pages/timeline/Timeline.tsx b/FrontEnd/src/pages/timeline/Timeline.tsx
index 3a7fbd00..f93e1623 100644
--- a/FrontEnd/src/pages/timeline/Timeline.tsx
+++ b/FrontEnd/src/pages/timeline/Timeline.tsx
@@ -41,7 +41,7 @@ const Timeline: React.FC<TimelineProps> = (props) => {
const [timeline, setTimeline] = React.useState<HttpTimelineInfo | null>(null);
const [posts, setPosts] = React.useState<HttpTimelinePostInfo[] | null>(null);
const [signalrState, setSignalrState] = React.useState<HubConnectionState>(
- HubConnectionState.Connecting
+ HubConnectionState.Connecting,
);
const [error, setError] = React.useState<
"offline" | "forbid" | "notfound" | "error" | null
@@ -81,7 +81,7 @@ const Timeline: React.FC<TimelineProps> = (props) => {
console.error(error);
setError("error");
}
- }
+ },
);
}, [timelineOwner, timelineName, timelineReloadKey]);
@@ -91,7 +91,7 @@ const Timeline: React.FC<TimelineProps> = (props) => {
.then(
(page) => {
setPosts(
- page.items.filter((p): p is HttpTimelinePostInfo => !p.deleted)
+ page.items.filter((p): p is HttpTimelinePostInfo => !p.deleted),
);
setTotalPage(page.totalPageCount);
},
@@ -106,14 +106,14 @@ const Timeline: React.FC<TimelineProps> = (props) => {
console.error(error);
setError("error");
}
- }
+ },
);
}, [timelineOwner, timelineName, postsReloadKey]);
React.useEffect(() => {
const timelinePostUpdate$ = getTimelinePostUpdate$(
timelineOwner,
- timelineName
+ timelineName,
);
const subscription = timelinePostUpdate$.subscribe(({ update, state }) => {
if (update) {
@@ -134,7 +134,7 @@ const Timeline: React.FC<TimelineProps> = (props) => {
.then(
(page) => {
const ps = page.items.filter(
- (p): p is HttpTimelinePostInfo => !p.deleted
+ (p): p is HttpTimelinePostInfo => !p.deleted,
);
setPosts((old) => [...(old ?? []), ...ps]);
},
@@ -149,7 +149,7 @@ const Timeline: React.FC<TimelineProps> = (props) => {
console.error(error);
setError("error");
}
- }
+ },
);
}, currentPage < totalPage);
@@ -183,7 +183,6 @@ const Timeline: React.FC<TimelineProps> = (props) => {
{timeline == null && posts == null && <TimelineLoading />}
{timeline && (
<TimelineCard
- className="timeline-card"
timeline={timeline}
connectionStatus={signalrState}
onReload={updateTimeline}