diff options
author | crupest <crupest@outlook.com> | 2020-06-10 00:24:16 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-10 00:24:24 +0800 |
commit | 0fd5c2026e266a8bf5f120cdd21b4cd5a5bae755 (patch) | |
tree | fbe9a7e89c8f20d93beea30e8504cb4d17beed56 /Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx | |
parent | c40fdd0eeb04622999c4d51f3ff5d32c598095c6 (diff) | |
download | timeline-0fd5c2026e266a8bf5f120cdd21b4cd5a5bae755.tar.gz timeline-0fd5c2026e266a8bf5f120cdd21b4cd5a5bae755.tar.bz2 timeline-0fd5c2026e266a8bf5f120cdd21b4cd5a5bae755.zip |
Rename.
Diffstat (limited to 'Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx')
-rw-r--r-- | Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx index cd9393c2..8fc3815b 100644 --- a/Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx +++ b/Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx @@ -68,17 +68,17 @@ export default function TimelinePageTemplateUI< }
}, []);
- const onLoadSubject = React.useMemo(() => new Subject(), []);
- const triggerLoadEvent = React.useCallback(() => {
- onLoadSubject.next(null);
- }, [onLoadSubject]);
+ const resizeSubject = React.useMemo(() => new Subject(), []);
+ const triggerResizeEvent = React.useCallback(() => {
+ resizeSubject.next(null);
+ }, [resizeSubject]);
React.useEffect(() => {
let jumpToBottom = true;
const timerTag = window.setTimeout(() => {
jumpToBottom = false;
}, 1000);
- const subscription = onLoadSubject.subscribe(() => {
+ const subscription = resizeSubject.subscribe(() => {
if (jumpToBottom)
window.scrollTo(0, document.body.getBoundingClientRect().height);
});
@@ -86,7 +86,7 @@ export default function TimelinePageTemplateUI< clearTimeout(timerTag);
subscription.unsubscribe();
};
- }, [onLoadSubject, timeline, props.posts]);
+ }, [resizeSubject, timeline, props.posts]);
const [cardHeight, setCardHeight] = React.useState<number>(0);
@@ -128,7 +128,7 @@ export default function TimelinePageTemplateUI< <Timeline
posts={props.posts}
onDelete={props.onDelete}
- onLoad={triggerLoadEvent}
+ onResize={triggerResizeEvent}
/>
);
if (props.onPost != null) {
|