From dcab88059b129eacfdf3b22ce0a1e577b7bea1bb Mon Sep 17 00:00:00 2001 From: Ali Waseem Date: Wed, 25 Mar 2026 02:07:49 -0600 Subject: [PATCH] fix: minor sentry issues (#44148) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? fixes: - [SUPABASE-APP-ER2](https://supabase.sentry.io/issues/7360649020/?project=5459134) - [SUPABASE-APP-ERM](https://supabase.sentry.io/issues/7361072759/?project=5459134) --------- Co-authored-by: Joshen Lim --- .../interfaces/App/CommandMenu/CreateCommands.tsx | 1 - apps/studio/hooks/misc/useSchemaQueryState.ts | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx b/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx index fb1c5140345..bb107f0a5fb 100644 --- a/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx +++ b/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx @@ -46,7 +46,6 @@ const EdgeFunctions = dynamic(() => import('icons').then((mod) => mod.EdgeFuncti const AnalyticsBucket = dynamic(() => import('icons').then((mod) => mod.AnalyticsBucket)) const FilesBucket = dynamic(() => import('icons').then((mod) => mod.FilesBucket)) const VectorBucket = dynamic(() => import('icons').then((mod) => mod.VectorBucket)) -const Graphql = dynamic(() => import('icons').then((mod) => mod.Graphql)) const CREATE_STUDIO_ENTITY = 'Create Studio Entity' diff --git a/apps/studio/hooks/misc/useSchemaQueryState.ts b/apps/studio/hooks/misc/useSchemaQueryState.ts index 12ab49493aa..e78eeb49765 100644 --- a/apps/studio/hooks/misc/useSchemaQueryState.ts +++ b/apps/studio/hooks/misc/useSchemaQueryState.ts @@ -1,8 +1,7 @@ +import { LOCAL_STORAGE_KEYS, useParams } from 'common' import { parseAsString, useQueryState } from 'nuqs' import { useEffect, useMemo } from 'react' -import { LOCAL_STORAGE_KEYS, useParams } from 'common' - /** * This hook wraps useQueryState because useQueryState imports app router for some reason which breaks the SSR in * the playwright tests. I've localized the issue to "NODE_ENV='test'" in the playwright tests. @@ -25,7 +24,7 @@ export const useQuerySchemaState = () => { const { ref } = useParams() const defaultSchema = - typeof window !== 'undefined' && ref && ref.length > 0 + typeof window !== 'undefined' && !!window.localStorage && ref && ref.length > 0 ? window.localStorage.getItem(LOCAL_STORAGE_KEYS.LAST_SELECTED_SCHEMA(ref)) || 'public' : 'public' @@ -36,7 +35,7 @@ export const useQuerySchemaState = () => { useEffect(() => { // Update the schema in local storage on every change - if (typeof window !== 'undefined' && ref && ref.length > 0) { + if (typeof window !== 'undefined' && !!window.localStorage && ref && ref.length > 0) { window.localStorage.setItem(LOCAL_STORAGE_KEYS.LAST_SELECTED_SCHEMA(ref), schema) } }, [schema, ref])