Skip to content

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

Update FlagProvider to retrieve flags without profile

Joshen Lime3111a5b47e4
diff --git a/studio/components/ui/Flag/FlagProvider.tsx b/studio/components/ui/Flag/FlagProvider.tsx
index 203b1d84ef7..bcbb1b05347 100644
--- a/studio/components/ui/Flag/FlagProvider.tsx
+++ b/studio/components/ui/Flag/FlagProvider.tsx
@@ -13,12 +13,15 @@ const FlagProvider: FC = ({ children }) => {
const { profile } = ui
useEffect(() => {
- if (IS_PLATFORM && profile) getFlags(profile)
+ if (IS_PLATFORM) getFlags(profile)
}, [profile])
- const getFlags = async (user: User) => {
+ const getFlags = async (user?: User) => {
const setFlagValues = async () => {
- const flagValues = await client.getAllValuesAsync({ identifier: user.primary_email })
+ const flagValues =
+ user !== undefined
+ ? await client.getAllValuesAsync({ identifier: user.primary_email })
+ : await client.getAllValuesAsync()
const flagStore: any = {}
flagValues.forEach((item: any) => {