import bookmarks from other platforms + many other improvements

This commit is contained in:
daniel31x13
2023-10-03 14:34:13 +03:30
parent 8fc8874063
commit f15e298cc3
13 changed files with 216 additions and 172 deletions
+5 -3
View File
@@ -17,7 +17,7 @@ export default function useLinks(
const { links, setLinks, resetLinks } = useLinkStore();
const router = useRouter();
const hasReachedBottom = useDetectPageBottom();
const { reachedBottom, setReachedBottom } = useDetectPageBottom();
const getLinks = async (isInitialCall: boolean, cursor?: number) => {
const requestBody: LinkRequestQuery = {
@@ -48,6 +48,8 @@ export default function useLinks(
}, [router, sort, searchFilter]);
useEffect(() => {
if (hasReachedBottom) getLinks(false, links?.at(-1)?.id);
}, [hasReachedBottom]);
if (reachedBottom) getLinks(false, links?.at(-1)?.id);
setReachedBottom(false);
}, [reachedBottom]);
}