From fe5128137f530daf8ca315cb89811121c6c2c9da Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Sat, 13 Feb 2021 21:23:30 +0800
Subject: ...

---
 .../src/app/views/timeline-common/TimelinePageTemplateUI.tsx   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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

diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
index 56be8cfe..d133bd34 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx
@@ -49,6 +49,9 @@ export default function TimelinePageTemplateUI<TManageItems>(
 
   const [bottomSpaceHeight, setBottomSpaceHeight] = React.useState<number>(0);
 
+  const [timelineReloadKey, setTimelineReloadKey] = React.useState<number>(0);
+  const reloadTimeline = (): void => setTimelineReloadKey((old) => old + 1);
+
   const onPostEditHeightChange = React.useCallback((height: number): void => {
     setBottomSpaceHeight(height);
     if (height === 0) {
@@ -122,7 +125,11 @@ export default function TimelinePageTemplateUI<TManageItems>(
             minHeight: `calc(100vh - ${56 + bottomSpaceHeight}px)`,
           }}
         >
-          <Timeline timelineName={timeline.name} />
+          <Timeline
+            timelineName={timeline.name}
+            reloadKey={timelineReloadKey}
+            onReload={reloadTimeline}
+          />
         </div>
         {timeline.postable ? (
           <>
@@ -134,6 +141,7 @@ export default function TimelinePageTemplateUI<TManageItems>(
               className="fixed-bottom"
               timeline={timeline}
               onHeightChange={onPostEditHeightChange}
+              onPosted={reloadTimeline}
             />
           </>
         ) : null}
-- 
cgit v1.2.3

