mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 17:22:48 -05:00
@@ -48,6 +48,7 @@ import { CollapseAllAction } from 'vs/base/browser/ui/tree/treeDefaults';
|
||||
import { ITreeItem, ITreeView } from 'sql/workbench/common/views';
|
||||
import { IOEShimService } from 'sql/workbench/parts/objectExplorer/browser/objectExplorerViewTreeShim';
|
||||
import { NodeContextKey } from 'sql/workbench/parts/dataExplorer/browser/nodeContext';
|
||||
import { UserCancelledConnectionError } from 'sql/base/common/errors';
|
||||
|
||||
export class CustomTreeViewPanel extends ViewletPanel {
|
||||
|
||||
@@ -700,6 +701,9 @@ class TreeDataSource implements IAsyncDataSource<ITreeItem, ITreeItem> {
|
||||
// So in order to enable this we need to tell the tree to refresh this node so it will ask us for the data again
|
||||
setTimeout(() => {
|
||||
this.treeView.collapse(node);
|
||||
if (e instanceof UserCancelledConnectionError) {
|
||||
return;
|
||||
}
|
||||
this.treeView.refresh([node]);
|
||||
});
|
||||
return [];
|
||||
|
||||
@@ -18,6 +18,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
|
||||
import { TreeItemCollapsibleState } from 'vs/workbench/common/views';
|
||||
import { localize } from 'vs/nls';
|
||||
import { NodeType } from 'sql/workbench/parts/objectExplorer/common/nodeType';
|
||||
import { UserCancelledConnectionError } from 'sql/base/common/errors';
|
||||
|
||||
export const SERVICE_ID = 'oeShimService';
|
||||
export const IOEShimService = createDecorator<IOEShimService>(SERVICE_ID);
|
||||
@@ -90,7 +91,7 @@ export class OEShimService extends Disposable implements IOEShimService {
|
||||
resolve(connProfile);
|
||||
},
|
||||
onConnectCanceled: () => {
|
||||
reject(new Error(localize('loginCanceled', "User canceled")));
|
||||
reject(new UserCancelledConnectionError(localize('loginCanceled', "User canceled")));
|
||||
},
|
||||
onConnectReject: undefined,
|
||||
onConnectStart: undefined,
|
||||
|
||||
Reference in New Issue
Block a user