Skip to content

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

fix: useLocalStorageQuery immediate query data update

Greg Richardson78e2251cf1f5
diff --git a/studio/hooks/misc/useLocalStorage.ts b/studio/hooks/misc/useLocalStorage.ts
index 954f928931b..222ac15dfcf 100644
--- a/studio/hooks/misc/useLocalStorage.ts
+++ b/studio/hooks/misc/useLocalStorage.ts
@@ -76,6 +76,7 @@ export function useLocalStorageQuery<T>(key: string, initialValue: T) {
window.localStorage.setItem(key, JSON.stringify(valueToStore))
}
+ queryClient.setQueryData(queryKey, valueToStore)
queryClient.invalidateQueries(queryKey)
}