Skip to content

Commit

Permalink
remove generic v2 root if it's the last one
Browse files Browse the repository at this point in the history
  • Loading branch information
alexyaang committed Sep 20, 2023
1 parent fa2bb67 commit 7b831f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export async function removeTrackedGenericV2Registry(context: IActionContext, no
}

await ext.genericRegistryV2DataProvider.removeTrackedRegistry(node.wrappedItem);

// remove the provider if it's the last one
if ((await ext.genericRegistryV2DataProvider.getRegistries(node.parent.wrappedItem)).length === 0) {
await ext.registriesTree.disconnectRegistryProvider(node.parent);
}

// don't wait
void ext.registriesTree.refresh();
}

0 comments on commit 7b831f4

Please sign in to comment.