Skip to content

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

fix: show loading state when apikeys is empty

phamhieu7b4e1d2de455
diff --git a/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx b/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx
index 8f59b791745..249b9f3c34d 100644
--- a/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx
+++ b/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx
@@ -26,10 +26,12 @@ const DisplayApiSettings = () => {
// Get the API service
const apiService = (services ?? []).find((x: any) => x.app.id == DEFAULT_API_SERVICE_ID)
const apiKeys = apiService?.service_api_keys ?? []
+ // api keys should not be empty. However it can be populated with a delay on project creation
+ const isApikeysEmpty = apiKeys.length === 0
return (
<ApiContentWrapper>
- {isProjectSettingsLoading || isJwtSecretUpdateStatusLoading ? (
+ {isProjectSettingsLoading || isJwtSecretUpdateStatusLoading || isApikeysEmpty ? (
<SettingsLoadingState
isError={isProjectSettingsError || isJwtSecretUpdateStatusError}
errorMessage="Failed to fetch API keys"