diff --git a/apps/frontend/src/components/autopost/autopost.tsx b/apps/frontend/src/components/autopost/autopost.tsx index 21af4652..456ffbfd 100644 --- a/apps/frontend/src/components/autopost/autopost.tsx +++ b/apps/frontend/src/components/autopost/autopost.tsx @@ -228,7 +228,14 @@ export const AddOrEditWebhook: FC<{ }, [] ); - const { data: dataList, isLoading } = useSWR('integrations', integration); + const { data: dataList, isLoading } = useSWR('integrations', integration, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const callBack = useCallback( async (values: any) => { await fetch(data?.id ? `/autopost/${data?.id}` : '/autopost', { diff --git a/apps/frontend/src/components/launches/calendar.context.tsx b/apps/frontend/src/components/launches/calendar.context.tsx index 3272fd0c..7ecdf006 100644 --- a/apps/frontend/src/components/launches/calendar.context.tsx +++ b/apps/frontend/src/components/launches/calendar.context.tsx @@ -176,8 +176,22 @@ export const CalendarWeekProvider: FC<{ return (await fetch('/sets')).json(); }, []); - const { data: sets, mutate } = useSWR('sets', setList); - const { data: sign } = useSWR('default-sign', defaultSign); + const { data: sets, mutate } = useSWR('sets', setList, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); + const { data: sign } = useSWR('default-sign', defaultSign, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const setFiltersWrapper = useCallback( (filters: { diff --git a/apps/frontend/src/components/launches/helpers/use.integration.list.tsx b/apps/frontend/src/components/launches/helpers/use.integration.list.tsx index 99acc5ee..4e3d2a55 100644 --- a/apps/frontend/src/components/launches/helpers/use.integration.list.tsx +++ b/apps/frontend/src/components/launches/helpers/use.integration.list.tsx @@ -12,6 +12,12 @@ export const useIntegrationList = () => { }, []); return useSWR('/integrations/list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); }; \ No newline at end of file diff --git a/apps/frontend/src/components/launches/tags.component.tsx b/apps/frontend/src/components/launches/tags.component.tsx index 2a21b857..b7da39e4 100644 --- a/apps/frontend/src/components/launches/tags.component.tsx +++ b/apps/frontend/src/components/launches/tags.component.tsx @@ -32,7 +32,14 @@ export const TagsComponent: FC<{ name: string; color: string; }[]; - }>('tags', loadTags); + }>('tags', loadTags, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const onDelete = useCallback( (tagIndex: number) => { const modify = tagValue.filter((_, i) => i !== tagIndex); diff --git a/apps/frontend/src/components/layout/continue.provider.tsx b/apps/frontend/src/components/layout/continue.provider.tsx index 7362af4d..38a1fa7b 100644 --- a/apps/frontend/src/components/layout/continue.provider.tsx +++ b/apps/frontend/src/components/layout/continue.provider.tsx @@ -22,6 +22,12 @@ export const ContinueProvider: FC = () => { return list; }, []); const { data: integrations } = useSWR('/integrations/list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); const closeModal = useCallback(() => { diff --git a/apps/frontend/src/components/onboarding/connect.channels.tsx b/apps/frontend/src/components/onboarding/connect.channels.tsx index fa749fac..96ed0ea1 100644 --- a/apps/frontend/src/components/onboarding/connect.channels.tsx +++ b/apps/frontend/src/components/onboarding/connect.channels.tsx @@ -160,6 +160,12 @@ export const ConnectChannels: FC = () => { }, []); const { data: integrations, mutate } = useSWR('/integrations/list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); @@ -223,7 +229,10 @@ export const ConnectChannels: FC = () => {
- setShowCustom(undefined)}> + setShowCustom(undefined)} + > {showCustom}
diff --git a/apps/frontend/src/components/platform-analytics/platform.analytics.tsx b/apps/frontend/src/components/platform-analytics/platform.analytics.tsx index 83059ad4..12e2f838 100644 --- a/apps/frontend/src/components/platform-analytics/platform.analytics.tsx +++ b/apps/frontend/src/components/platform-analytics/platform.analytics.tsx @@ -51,6 +51,12 @@ export const PlatformAnalytics = () => { return int.filter((f: any) => allowedIntegrations.includes(f.identifier)); }, []); const { data, isLoading } = useSWR('analytics-list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); const sortedIntegrations = useMemo(() => { diff --git a/apps/frontend/src/components/plugs/plugs.tsx b/apps/frontend/src/components/plugs/plugs.tsx index 16338f16..ca9ae180 100644 --- a/apps/frontend/src/components/plugs/plugs.tsx +++ b/apps/frontend/src/components/plugs/plugs.tsx @@ -34,9 +34,21 @@ export const Plugs = () => { load2, { fallbackData: [], + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, } ); const { data, isLoading } = useSWR('analytics-list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); diff --git a/apps/frontend/src/components/sets/sets.tsx b/apps/frontend/src/components/sets/sets.tsx index b088e068..c0b440e2 100644 --- a/apps/frontend/src/components/sets/sets.tsx +++ b/apps/frontend/src/components/sets/sets.tsx @@ -68,6 +68,12 @@ export const Sets: FC = () => { }, []); const { isLoading, data: integrations } = useSWR('/integrations/list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); @@ -75,7 +81,14 @@ export const Sets: FC = () => { return (await fetch('/sets')).json(); }, []); - const { data, mutate } = useSWR('sets', list); + const { data, mutate } = useSWR('sets', list, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const addSet = useCallback( (params?: { id?: string; name?: string; content?: string }) => () => { diff --git a/apps/frontend/src/components/standalone-modal/standalone.modal.tsx b/apps/frontend/src/components/standalone-modal/standalone.modal.tsx index da781301..35a49da6 100644 --- a/apps/frontend/src/components/standalone-modal/standalone.modal.tsx +++ b/apps/frontend/src/components/standalone-modal/standalone.modal.tsx @@ -27,6 +27,12 @@ export const StandaloneModal: FC = () => { data: integrations, mutate, } = useSWR('/integrations/list', load, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, fallbackData: [], }); const { isLoading: isLoading2, data } = useSWR('/posts/find-slot', loadDate, { diff --git a/apps/frontend/src/components/third-parties/third-party.component.tsx b/apps/frontend/src/components/third-parties/third-party.component.tsx index 9becc9cb..e6f344bc 100644 --- a/apps/frontend/src/components/third-parties/third-party.component.tsx +++ b/apps/frontend/src/components/third-parties/third-party.component.tsx @@ -102,7 +102,14 @@ export const ThirdPartyComponent = () => { return (await fetch('/third-party')).json(); }, []); - const { data, isLoading, mutate } = useSWR('third-party', integrations); + const { data, isLoading, mutate } = useSWR('third-party', integrations, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const [collapseMenu, setCollapseMenu] = useCookie('collapseMenu', '0'); return ( @@ -141,7 +148,11 @@ export const ThirdPartyComponent = () => {
-
+
{!isLoading && !data?.length ? (
No Integrations Yet
) : ( diff --git a/apps/frontend/src/components/third-parties/third-party.list.component.tsx b/apps/frontend/src/components/third-parties/third-party.list.component.tsx index de95c9dd..6e6d8ed2 100644 --- a/apps/frontend/src/components/third-parties/third-party.list.component.tsx +++ b/apps/frontend/src/components/third-parties/third-party.list.component.tsx @@ -103,7 +103,14 @@ export const ThirdPartyListComponent: FC<{ reload: () => void }> = (props) => { return (await fetch('/third-party/list')).json(); }, []); - const { data } = useSWR('third-party-list', integrationsList); + const { data } = useSWR('third-party-list', integrationsList, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const addApiKey = useCallback( (title: string, identifier: string) => () => { diff --git a/apps/frontend/src/components/third-parties/third-party.media.tsx b/apps/frontend/src/components/third-parties/third-party.media.tsx index 0545c627..e4a7d639 100644 --- a/apps/frontend/src/components/third-parties/third-party.media.tsx +++ b/apps/frontend/src/components/third-parties/third-party.media.tsx @@ -205,7 +205,14 @@ export const ThirdPartyMedia: FC<{ ); }, []); - const { data, isLoading, mutate } = useSWR('third-party', thirdParties); + const { data, isLoading, mutate } = useSWR('third-party', thirdParties, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); if (isLoading || !data.length) { return null; diff --git a/apps/frontend/src/components/webhooks/webhooks.tsx b/apps/frontend/src/components/webhooks/webhooks.tsx index 96498287..6f5d87a3 100644 --- a/apps/frontend/src/components/webhooks/webhooks.tsx +++ b/apps/frontend/src/components/webhooks/webhooks.tsx @@ -164,7 +164,14 @@ export const AddOrEditWebhook: FC<{ }, [] ); - const { data: dataList, isLoading } = useSWR('integrations', integration); + const { data: dataList, isLoading } = useSWR('integrations', integration, { + revalidateOnFocus: false, + revalidateOnReconnect: false, + revalidateIfStale: false, + revalidateOnMount: true, + refreshWhenHidden: false, + refreshWhenOffline: false, + }); const callBack = useCallback( async (values: any) => { await fetch('/webhooks', {