mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 23:29:08 +03:00
Fetch the snippet content if it's empty.
This commit is contained in:
1 parent
e053898592
commit
092d30d438
1 file changed
+3
-1
@@ -39,7 +39,9 @@ const SqlEditor: NextPageWithLayout = () => {
|
||||
|
||||
// Don't fetch the snippet if it already exists in the state. This avoids a race condition where
|
||||
// the snippet is inserted and fetched at the same time.
|
||||
const existsSnippet = id ? !!snapV2.snippets[id] : undefined
|
||||
const existsSnippet = id
|
||||
? id in snapV2.snippets && snapV2.snippets[id].snippet?.content !== undefined
|
||||
: undefined
|
||||
|
||||
useContentIdQuery(
|
||||
{ projectRef: ref, id },
|
||||
|
||||
Reference in new issue
Block a user