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 | fe5128137f530daf8ca315cb89811121c6c2c9da (patch) | |
| tree | 34cbdb7895e18d34779b2209a1e9aae0fde20cf2 /FrontEnd/src/app/views/timeline-common/TimelinePageTemplateUI.tsx | |
| parent | aeed3cb80d8c0a62d0ccc565733c4a213759c5bd (diff) | |
| download | timeline-fe5128137f530daf8ca315cb89811121c6c2c9da.tar.gz timeline-fe5128137f530daf8ca315cb89811121c6c2c9da.tar.bz2 timeline-fe5128137f530daf8ca315cb89811121c6c2c9da.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} |
