From e7f7afdc52993b02560ec8f305e52075d3a3bbd5 Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Mon, 20 May 2024 00:59:03 +0200 Subject: [PATCH] Fix useEffect hook in Navbar.tsx to only fetch links on SheetTrigger click once. --- components/Navbar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 3dcf65e..45c4fa2 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -74,6 +74,7 @@ function Navbar() { }, [shouldFocusInput]); const fetchLinks = async () => { + if (links.length > 0) return; try { const res = await pb.collection("categories").getFullList({ expand: "items",