mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Refactor node loading logic for tree controllers (#8980)
* Refactor node loading logic for tree controllers * Add comment
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { TreeNode } from './treeNode';
|
||||
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
|
||||
import { AddControllerNode } from './addControllerNode';
|
||||
@@ -13,6 +14,8 @@ import { showErrorMessage } from '../utils';
|
||||
import { LoadingControllerNode } from './loadingControllerNode';
|
||||
import { AuthType } from '../constants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
const CredentialNamespace = 'clusterControllerCredentials';
|
||||
|
||||
interface IControllerInfoSlim {
|
||||
@@ -43,7 +46,9 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
return this.root.getChildren();
|
||||
}
|
||||
|
||||
await this.loadSavedControllers();
|
||||
// Kick off loading the saved controllers but then immediately return the loading node so
|
||||
// the user isn't left with an empty tree while we load the nodes
|
||||
this.loadSavedControllers().catch(err => { vscode.window.showErrorMessage(localize('bdc.controllerTreeDataProvider.error', "Unexpected error loading saved controllers: {0}", err)); });
|
||||
return [new LoadingControllerNode()];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user