fix(sidebar): search databases across connections
This commit is contained in:
1 parent
cfd5f31473
commit
9dbd4902e5
4 files changed
+123
-3
No files matched your search
@@ -163,6 +163,12 @@ function isSimpleObjectSearchParent(node: TreeNode): boolean {
|
||||
}
|
||||
|
||||
function collectExpandedObjectSearchTargets(node: TreeNode, tasks: Promise<void>[], refreshedNodeIds?: Set<string>) {
|
||||
if (refreshedNodeIds && node.type === "connection" && node.connectionId) {
|
||||
if (store.connectedIds.has(node.connectionId)) {
|
||||
tasks.push(store.loadConnectedConnectionRootForSidebarSearch(node.connectionId));
|
||||
}
|
||||
if (node.connectionId !== store.activeConnectionId) return;
|
||||
}
|
||||
if (refreshedNodeIds && isSimpleObjectSearchParent(node)) {
|
||||
refreshedNodeIds.add(node.id);
|
||||
tasks.push(store.refreshTreeNode(node));
|
||||
|
||||
@@ -479,14 +479,14 @@ async function toggle() {
|
||||
const databaseObjectGroup = node.type === "group-tables" || node.type === "group-views" || node.type === "group-materialized-views" || node.type === "group-procedures" || node.type === "group-functions" || node.type === "group-sequences" || node.type === "group-packages";
|
||||
if (databaseObjectGroup && connectionStore.isTreeNodeChildrenLoaded(node.id)) {
|
||||
node.isExpanded = !node.isExpanded;
|
||||
if (wasExpanded) connectionStore.releaseCollapsedTreeNodeChildren(node.id);
|
||||
if (wasExpanded && !connectionStore.sidebarSearchQuery) connectionStore.releaseCollapsedTreeNodeChildren(node.id);
|
||||
emit("node-toggled", node, wasExpanded);
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.isExpanded) {
|
||||
node.isExpanded = false;
|
||||
connectionStore.releaseCollapsedTreeNodeChildren(node.id);
|
||||
if (!connectionStore.sidebarSearchQuery) connectionStore.releaseCollapsedTreeNodeChildren(node.id);
|
||||
emit("node-toggled", node, wasExpanded);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user