From b9703104b5b416dd3211adedb878d1916072c96d Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Sat, 13 Feb 2021 16:35:39 +0800
Subject: ...

---
 .../src/app/views/timeline-common/TimelinePageTemplate.tsx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

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

diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
index caab1768..6a8dd63c 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
@@ -16,12 +16,14 @@ export interface TimelinePageTemplateProps<TManageItem> {
     Omit<TimelinePageTemplateUIProps<TManageItem>, "CardComponent">
   >;
   notFoundI18nKey: string;
+  reloadKey: number;
+  onReload: () => void;
 }
 
 export default function TimelinePageTemplate<TManageItem>(
   props: TimelinePageTemplateProps<TManageItem>
 ): React.ReactElement | null {
-  const { name } = props;
+  const { name, reloadKey, onReload } = props;
 
   const [dialog, setDialog] = React.useState<null | "property" | "member">(
     null
@@ -68,7 +70,7 @@ export default function TimelinePageTemplate<TManageItem>(
     return () => {
       subscribe = false;
     };
-  }, [name]);
+  }, [name, reloadKey]);
 
   let dialogElement: React.ReactElement | undefined;
   const closeDialog = (): void => setDialog(null);
@@ -85,6 +87,7 @@ export default function TimelinePageTemplate<TManageItem>(
         open
         close={closeDialog}
         timeline={timeline}
+        onChange={onReload}
       />
     );
   } else if (dialog === "member") {
@@ -95,7 +98,12 @@ export default function TimelinePageTemplate<TManageItem>(
     }
 
     dialogElement = (
-      <TimelineMemberDialog open onClose={closeDialog} timeline={timeline} />
+      <TimelineMemberDialog
+        open
+        onClose={closeDialog}
+        timeline={timeline}
+        onChange={onReload}
+      />
     );
   }
 
-- 
cgit v1.2.3

