import { DeploymentsTreeItem , disconnectRepo as disconnectRepository } from "vscode-azureappservice" ; import { IActionContext } from "vscode-azureextensionui" ; import { ext } from "../../extensionVariables" ; import { SlotTreeItemBase } from '../../tree/SlotTreeItemBase' ; export async function disconnectRepo ( context , node ? ) { if ( ! node ) { node = await ext . tree . showTreeItemPicker < DeploymentsTreeItem > ( DeploymentsTreeItem . contextValueConnected , context ) ; } if ( node . parent instanceof SlotTreeItemBase ) { await disconnectRepository ( context , node . site , node . subscription ) ; await node . refresh ( context ) ; } else { throw Error ( 'Internal error: Action not supported.' ) ; } }