Fixing edited connections not working for root in Async Server Tree (#22580)

* Fixing edited connections not working for root

* Fixing comment
This commit is contained in:
Aasim Khan
2023-04-03 11:58:19 -07:00
committed by GitHub
parent 15ecdc8653
commit 38a3312cb6

View File

@@ -106,7 +106,9 @@ export class AsyncServerTree extends WorkbenchAsyncDataTree<ConnectionProfileGro
while (stack.length > 0) {
const node = stack.pop();
if (node) {
if (!this.isCollapsed(node.element)) {
// The root of the tree is a special case connection group that is always expanded. It is not rendered
// and this.isCollapsed returns an error when called on it. So we need to check for it explicitly.
if (node === this.root || !this.isCollapsed(node.element)) {
expanded.push(node.element);
if (node.children) {
node.children.forEach(child => stack.push(child));