mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-21 16:55:25 +03:00
Revert flush to cancel, speed up scroll position caching
Somehow the flush cache the scroll position for a different status ID
This commit is contained in:
parent
6e9661a70c
commit
8e4ecd242b
1 changed files with 2 additions and 2 deletions
|
@ -62,13 +62,13 @@ function StatusPage() {
|
|||
if (uiState !== 'loading') {
|
||||
states.scrollPositions[id] = scrollTop;
|
||||
}
|
||||
}, 100);
|
||||
}, 50);
|
||||
scrollableRef.current.addEventListener('scroll', onScroll, {
|
||||
passive: true,
|
||||
});
|
||||
onScroll();
|
||||
return () => {
|
||||
onScroll.flush();
|
||||
onScroll.cancel();
|
||||
scrollableRef.current?.removeEventListener('scroll', onScroll);
|
||||
};
|
||||
}, [id, uiState !== 'loading']);
|
||||
|
|
Loading…
Reference in a new issue