fix(sidebar): clear children cache before refreshing expanded nodes

When refreshAllTree skipped collapsed child nodes, their IDs remained
in loadedTreeNodeChildrenIds. After the parent was rebuilt with fresh
children, expanding a previously-collapsed node hit useCachedChildren
and returned immediately with empty children.
This commit is contained in:
t8y2 2026-05-12 14:06:10 +08:00
parent 03cc4ba80a
commit 76ff987d00
1 changed files with 1 additions and 0 deletions

View File

@ -1089,6 +1089,7 @@ export const useConnectionStore = defineStore("connection", () => {
continue;
}
if (!expandedIds.has(node.id)) continue;
clearLoadedChildrenCache(node.id);
node.children = [];
await loadTreeNodeChildren(node, { force: true });
await restoreExpandedChildren(node, expandedIds, { force: true });