mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix BDC tree getting stuck loading (#20116)
This commit is contained in:
@@ -42,12 +42,11 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.initialized) {
|
if (!this.initialized) {
|
||||||
this.loadSavedControllers().catch(err => { vscode.window.showErrorMessage(localize('bdc.controllerTreeDataProvider.error', "Unexpected error loading saved controllers: {0}", err)); });
|
try {
|
||||||
} else {
|
await this.loadSavedControllers();
|
||||||
// We set the context here since VS Code takes a bit of time to process the _onDidChangeTreeData
|
} catch (err) {
|
||||||
// and so if we set it as soon as we finished loading the controllers it would briefly flash
|
void vscode.window.showErrorMessage(localize('bdc.controllerTreeDataProvider.error', "Unexpected error loading saved controllers: {0}", err));
|
||||||
// the "connect to controller" welcome view
|
}
|
||||||
await vscode.commands.executeCommand('setContext', 'bdc.loaded', true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.root.getChildren();
|
return this.root.getChildren();
|
||||||
@@ -132,13 +131,12 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
|||||||
|
|
||||||
this.root.clearChildren();
|
this.root.clearChildren();
|
||||||
treeNodes.forEach(node => this.root.addChild(node));
|
treeNodes.forEach(node => this.root.addChild(node));
|
||||||
this.notifyNodeChanged();
|
await vscode.commands.executeCommand('setContext', 'bdc.loaded', true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Reset so we can try again if the tree refreshes
|
// Reset so we can try again if the tree refreshes
|
||||||
this.initialized = false;
|
this.initialized = false;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async saveControllers(): Promise<void> {
|
public async saveControllers(): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user