From d0a318625a30f32e5c0aef24c1882a52de164eb3 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Sat, 20 Feb 2021 15:19:58 +0800
Subject: fix: Fix reload logic.

---
 FrontEnd/src/app/views/timeline-common/Timeline.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'FrontEnd/src/app/views/timeline-common/Timeline.tsx')

diff --git a/FrontEnd/src/app/views/timeline-common/Timeline.tsx b/FrontEnd/src/app/views/timeline-common/Timeline.tsx
index d40f8e94..3f2cbfb5 100644
--- a/FrontEnd/src/app/views/timeline-common/Timeline.tsx
+++ b/FrontEnd/src/app/views/timeline-common/Timeline.tsx
@@ -42,9 +42,11 @@ const Timeline: React.FC<TimelineProps> = (props) => {
   >("loading");
 
   React.useEffect(() => {
-    let subscribe = true;
-
     setPosts("loading");
+  }, [timelineName]);
+
+  React.useEffect(() => {
+    let subscribe = true;
 
     void getHttpTimelineClient()
       .listPost(timelineName)
-- 
cgit v1.2.3

