From b175fc7d7bf533c8ebd3210920eb72e9aa336636 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Thu, 26 Feb 2026 17:49:48 -0500 Subject: [PATCH] don't revalidate unless needed for some hook --- app/(home-pages)/home/HomeLayout.tsx | 6 +++++- app/(home-pages)/reader/GlobalContent.tsx | 2 ++ components/IdentityProvider.tsx | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/(home-pages)/home/HomeLayout.tsx b/app/(home-pages)/home/HomeLayout.tsx index 7dab4018..6951ebd9 100644 --- a/app/(home-pages)/home/HomeLayout.tsx +++ b/app/(home-pages)/home/HomeLayout.tsx @@ -137,7 +137,11 @@ export function HomeLeafletList(props: { return { ...result, titles }; } }, - { fallbackData: { facts: props.initialFacts, titles: props.titles } }, + { + fallbackData: { facts: props.initialFacts, titles: props.titles }, + revalidateOnFocus: false, + revalidateOnReconnect: false, + }, ); let { data: localLeaflets } = useSWR("leaflets", () => getHomeDocs(), { diff --git a/app/(home-pages)/reader/GlobalContent.tsx b/app/(home-pages)/reader/GlobalContent.tsx index 53cf2462..b8fc3fb9 100644 --- a/app/(home-pages)/reader/GlobalContent.tsx +++ b/app/(home-pages)/reader/GlobalContent.tsx @@ -22,6 +22,8 @@ export const GlobalContent = (props: { }, { fallbackData: { posts: initialData.posts }, + revalidateOnFocus: false, + revalidateOnReconnect: false, }, ); diff --git a/components/IdentityProvider.tsx b/components/IdentityProvider.tsx index a880080e..1e81244c 100644 --- a/components/IdentityProvider.tsx +++ b/components/IdentityProvider.tsx @@ -34,6 +34,10 @@ export function IdentityContextProvider(props: { }) { let { data: identity, mutate } = useSWR("identity", () => getIdentityData(), { fallbackData: props.initialValue, + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: false, }); useEffect(() => { mutate(props.initialValue); -- 2.51.2