aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-07-06 00:56:39 +0800
committercrupest <crupest@outlook.com>2021-07-06 00:56:39 +0800
commit655e3902c6d8ca4d14810705e85e9817e4b76f1e (patch)
tree1bcbb64dbdd7bbc7a0ca0b30cca5e786890fa062 /FrontEnd
parentf5724eb2c7db9d38624bb1bbff30a6eb631e5ed8 (diff)
downloadtimeline-655e3902c6d8ca4d14810705e85e9817e4b76f1e.tar.gz
timeline-655e3902c6d8ca4d14810705e85e9817e4b76f1e.tar.bz2
timeline-655e3902c6d8ca4d14810705e85e9817e4b76f1e.zip
fix: Fx a logic error.
Diffstat (limited to 'FrontEnd')
-rw-r--r--FrontEnd/src/views/timeline-common/Timeline.tsx7
1 files changed, 6 insertions, 1 deletions
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<TimelineProps> = (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<TimelineProps> = (props) => {
/>
{timeline?.postable ? (
<TimelinePostEdit timeline={timeline} onPosted={onReload.current} />
- ) : (
+ ) : user == null ? (
<TimelinePostEditNoLogin />
+ ) : (
+ <TimelineEmptyItem startSegmentLength={20} center="none" current />
)}
</div>
);