1
0
Fork 0

Fix this somehow-partially implemented dot shortcut

This commit is contained in:
Lim Chee Aun 2024-03-24 00:21:41 +08:00
parent f6a9f7807e
commit 0fbc566454

View file

@ -209,17 +209,13 @@ function Timeline({
const showNewPostsIndicator =
items.length > 0 && uiState !== 'loading' && showNew;
const handleLoadNewPosts = useCallback(() => {
loadItems(true);
if (showNewPostsIndicator) loadItems(true);
scrollableRef.current?.scrollTo({
top: 0,
behavior: 'smooth',
});
}, [loadItems]);
const dotRef = useHotkeys('.', () => {
if (showNewPostsIndicator) {
handleLoadNewPosts();
}
});
}, [loadItems, showNewPostsIndicator]);
const dotRef = useHotkeys('.', handleLoadNewPosts);
// const {
// scrollDirection,
@ -365,6 +361,7 @@ function Timeline({
jRef.current = node;
kRef.current = node;
oRef.current = node;
dotRef.current = node;
}}
tabIndex="-1"
>