From 655e3902c6d8ca4d14810705e85e9817e4b76f1e Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 6 Jul 2021 00:56:39 +0800 Subject: fix: Fx a logic error. --- FrontEnd/src/views/timeline-common/Timeline.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'FrontEnd/src') diff --git a/FrontEnd/src/views/timeline-common/Timeline.tsx b/FrontEnd/src/views/timeline-common/Timeline.tsx index d812463a..e028dddc 100644 --- a/FrontEnd/src/views/timeline-common/Timeline.tsx +++ b/FrontEnd/src/views/timeline-common/Timeline.tsx @@ -14,6 +14,7 @@ import { } from "@/http/timeline"; import { getTimelinePostUpdate$ } from "@/services/timeline"; +import { useUser } from "@/services/user"; import useValueWithRef from "@/utilities/useValueWithRef"; @@ -38,6 +39,8 @@ export interface TimelineProps { const Timeline: React.FC = (props) => { const { timelineName, className, style, reloadKey } = props; + const user = useUser(); + const [state, setState] = React.useState< "loading" | "loaded" | "offline" | "notexist" | "forbid" | "error" >("loading"); @@ -149,8 +152,10 @@ const Timeline: React.FC = (props) => { /> {timeline?.postable ? ( - ) : ( + ) : user == null ? ( + ) : ( + )} ); -- cgit v1.2.3