Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: minor fix (#13770)

Liu Ji6c88fba45073
diff --git a/frontend/src/components/ProvideSQLEditorContext.vue b/frontend/src/components/ProvideSQLEditorContext.vue
index 70e4ed9274..1298358fa1 100644
--- a/frontend/src/components/ProvideSQLEditorContext.vue
+++ b/frontend/src/components/ProvideSQLEditorContext.vue
@@ -168,10 +168,6 @@ const initializeProjects = async () => {
const handleProjectSwitched = async () => {
const { project } = editorStore;
- if (!project) {
- editorStore.databaseList = [];
- return;
- }
if (project) {
await projectStore.getOrFetchProjectByName(project, true /* silent */);
} else {
@@ -186,6 +182,10 @@ const prepareDatabases = async () => {
return;
}
const { project } = editorStore;
+ if (!project) {
+ editorStore.databaseList = [];
+ return;
+ }
// `databaseList` is the database list in the project.
const { databaseList, ready } = useDatabaseV1List(project);
await wrapRefAsPromise(ready, true);