mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-13 09:28:50 +01: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') {
|
if (uiState !== 'loading') {
|
||||||
states.scrollPositions[id] = scrollTop;
|
states.scrollPositions[id] = scrollTop;
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 50);
|
||||||
scrollableRef.current.addEventListener('scroll', onScroll, {
|
scrollableRef.current.addEventListener('scroll', onScroll, {
|
||||||
passive: true,
|
passive: true,
|
||||||
});
|
});
|
||||||
onScroll();
|
onScroll();
|
||||||
return () => {
|
return () => {
|
||||||
onScroll.flush();
|
onScroll.cancel();
|
||||||
scrollableRef.current?.removeEventListener('scroll', onScroll);
|
scrollableRef.current?.removeEventListener('scroll', onScroll);
|
||||||
};
|
};
|
||||||
}, [id, uiState !== 'loading']);
|
}, [id, uiState !== 'loading']);
|
||||||
|
|
Loading…
Reference in a new issue