From 81abec453ef0d1a89fcb1bcc0fbdadf5c203c193 Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Fri, 8 Dec 2023 00:13:34 +0100 Subject: [PATCH] fix: db schema autocomplete (#2809) --- frontend/src/lib/components/Editor.svelte | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index 2561544be7..f260f67075 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -241,19 +241,13 @@ let sqlSchemaCompletor: Disposable | undefined = undefined - let oldSchemaRes = '' function updateSchema() { const newSchemaRes = lang === 'graphql' ? args?.api : args?.database if (typeof newSchemaRes === 'string') { - const newSchema = $dbSchemas[newSchemaRes.replace('$res:', '')] - if (newSchema && newSchemaRes !== oldSchemaRes) { - oldSchemaRes = newSchemaRes - dbSchema = newSchema - return - } + dbSchema = $dbSchemas[newSchemaRes.replace('$res:', '')] + } else { + dbSchema = undefined } - dbSchema = undefined - oldSchemaRes = '' } $: lang && args && $dbSchemas && updateSchema()