Only allow one arc controller connection (#12685)

This commit is contained in:
Charles Gagnon
2020-09-30 15:06:22 -07:00
committed by GitHub
parent 7bfea07b9b
commit fac642de1e
2 changed files with 9 additions and 0 deletions

View File

@@ -26,6 +26,14 @@ export async function activate(context: vscode.ExtensionContext): Promise<arc.IE
});
vscode.commands.registerCommand('arc.connectToController', async () => {
const nodes = await treeDataProvider.getChildren();
if (nodes.length > 0) {
const response = await vscode.window.showErrorMessage(loc.onlyOneControllerSupported, loc.yes, loc.no);
if (response !== loc.yes) {
return;
}
await treeDataProvider.removeController(nodes[0] as ControllerTreeNode);
}
const dialog = new ConnectToControllerDialog(treeDataProvider);
dialog.showDialog();
const model = await dialog.waitForClose();