disabled prefetch in link component and other fixes

This commit is contained in:
Ren Amamiya
2023-04-20 10:57:32 +07:00
parent 8bf3c79a0b
commit 5c01b91771
6 changed files with 18 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ export default function Page() {
const [lastLogin] = useLocalStorage('lastLogin', new Date());
const now = useRef(new Date());
const eose = useRef(0);
const timeout = useRef(null);
const unsubscribe = useRef(null);
const fetchData = useCallback(
@@ -119,7 +119,7 @@ export default function Page() {
},
undefined,
() => {
router.replace('/nostr/newsfeed/following');
timeout.current = setTimeout(() => router.replace('/nostr/newsfeed/following'), 5000);
},
{
unsubscribeOnEose: true,
@@ -157,6 +157,7 @@ export default function Page() {
if (unsubscribe.current) {
unsubscribe.current();
}
clearTimeout(timeout.current);
};
}, [fetchData, router]);