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 | 5de8d90be2ddfa43c355aa13e9e8162490e4cc96 (patch) | |
tree | c55d4a1f06aa6b52391982560057e076c95a6365 /Timeline/ClientApp/src/timeline/TimelinePageTemplateUI.tsx | |
parent | 1f316209a28355d5af51226865833be31e5ec97d (diff) | |
download | timeline-5de8d90be2ddfa43c355aa13e9e8162490e4cc96.tar.gz timeline-5de8d90be2ddfa43c355aa13e9e8162490e4cc96.tar.bz2 timeline-5de8d90be2ddfa43c355aa13e9e8162490e4cc96.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) {
|