Test add this as dep

This commit is contained in:
Lim Chee Aun 2023-03-24 01:04:47 +08:00
parent 5208df4a28
commit 11324364a5

View file

@ -193,7 +193,8 @@ function Timeline({
}, [nearReachEnd, showMore]);
const lastHiddenTime = useRef();
usePageVisibility((visible) => {
usePageVisibility(
(visible) => {
if (visible) {
const timeDiff = Date.now() - lastHiddenTime.current;
if (!lastHiddenTime.current || timeDiff > 1000 * 60) {
@ -210,7 +211,9 @@ function Timeline({
lastHiddenTime.current = Date.now();
}
setVisible(visible);
}, []);
},
[checkForUpdates],
);
// checkForUpdates interval
useInterval(