diff options
author | crupest <crupest@outlook.com> | 2021-02-13 21:23:30 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-13 21:23:30 +0800 |
commit | c8bd19aacf9059f740df4f6fa9890127c20c1f6d (patch) | |
tree | 01b3d74965415aff1ab1ef36fb9c92551c2166a4 /FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx | |
parent | b9703104b5b416dd3211adedb878d1916072c96d (diff) | |
download | timeline-c8bd19aacf9059f740df4f6fa9890127c20c1f6d.tar.gz timeline-c8bd19aacf9059f740df4f6fa9890127c20c1f6d.tar.bz2 timeline-c8bd19aacf9059f740df4f6fa9890127c20c1f6d.zip |
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx')
-rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
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} |