mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
Fix saving snippet outisde of sql editor + fix deleting snippet not rendering next one properly
This commit is contained in:
1 parent
c42cf4d4b3
commit
40ab79e5b5
2 files changed
+5
-2
No files matched your search
@@ -85,7 +85,7 @@ const QueryItemActions = observer(({ tabInfo }: { tabInfo: SqlSnippet }) => {
|
||||
try {
|
||||
await deleteContent({ projectRef: ref, id })
|
||||
|
||||
const existingSnippetIds = Object.keys(snap.snippets)
|
||||
const existingSnippetIds = Object.keys(snap.snippets).filter((x) => x !== id)
|
||||
if (existingSnippetIds.length === 0) {
|
||||
router.push(`/project/${ref}/sql`)
|
||||
} else {
|
||||
|
||||
@@ -68,7 +68,10 @@ export const sqlEditorState = proxy({
|
||||
}
|
||||
sqlEditorState.results[snippet.id] = []
|
||||
sqlEditorState.savingStates[snippet.id] = 'IDLE'
|
||||
if (!sqlEditorState.orders[projectRef].includes(snippet.id)) {
|
||||
if (
|
||||
sqlEditorState.orders[projectRef] !== undefined &&
|
||||
!sqlEditorState.orders[projectRef].includes(snippet.id)
|
||||
) {
|
||||
sqlEditorState.orders[projectRef].unshift(snippet.id)
|
||||
}
|
||||
if (isNew) {
|
||||
|
||||
Reference in new issue
Block a user