fix: only show configured database in sidebar when specified (#160)

This commit is contained in:
t8y2 2026-05-08 19:52:36 +08:00
parent 0e6617c817
commit e83a3bbab9
1 changed files with 5 additions and 1 deletions

View File

@ -361,7 +361,11 @@ export const useConnectionStore = defineStore("connection", () => {
node.isLoading = true;
try {
await ensureConnected(connectionId);
const databases = await api.listDatabases(connectionId);
let databases = await api.listDatabases(connectionId);
const config = getConfig(connectionId);
if (config?.database) {
databases = databases.filter((db) => db.name === config.database);
}
setChildren(
node,
databases.map((db) => ({