Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: don't refetch settings on inactive projects (#36017)

Alaister Young9b1f64fbfa3c
diff --git a/apps/studio/data/config/project-settings-v2-query.ts b/apps/studio/data/config/project-settings-v2-query.ts
index fd575085cc9..b76d50f85f9 100644
--- a/apps/studio/data/config/project-settings-v2-query.ts
+++ b/apps/studio/data/config/project-settings-v2-query.ts
@@ -51,9 +51,11 @@ export const useProjectSettingsV2Query = <TData = ProjectSettingsData>(
({ signal }) => getProjectSettings({ projectRef }, signal),
{
enabled: enabled && typeof projectRef !== 'undefined',
- refetchInterval(data) {
- const apiKeys = (data as ProjectSettings)?.service_api_keys ?? []
- const interval = canReadAPIKeys && apiKeys.length === 0 ? 2000 : 0
+ refetchInterval(_data) {
+ const data = _data as ProjectSettings | undefined
+ const apiKeys = data?.service_api_keys ?? []
+ const interval =
+ canReadAPIKeys && data?.status !== 'INACTIVE' && apiKeys.length === 0 ? 2000 : 0
return interval
},
...options,