Skip to content

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

fix: insert source after from command in log explorer (#21114)

Faisalb4a1945a82e9
diff --git a/apps/studio/pages/project/[ref]/logs/explorer/index.tsx b/apps/studio/pages/project/[ref]/logs/explorer/index.tsx
index fc33c949ec3..2f4c666aba0 100644
--- a/apps/studio/pages/project/[ref]/logs/explorer/index.tsx
+++ b/apps/studio/pages/project/[ref]/logs/explorer/index.tsx
@@ -135,7 +135,11 @@ export const LogsExplorerPage: NextPageWithLayout = () => {
}
const handleInsertSource = (source: LogsTableName) => {
- setEditorValue((prev) => prev + source)
+ setEditorValue((prev) => {
+ const index = prev.indexOf('from')
+ if (index === -1) return `${prev}${source}`
+ return `${prev.substring(0, index + 4)} ${source} ${prev.substring(index + 5)}`
+ })
setEditorId(uuidv4())
}