mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
Fix floating promises in connection widget (#8198)
* Fix floating promises in connection widget * PR feedback * More feedback changes * Couple missed promises
This commit is contained in:
@@ -323,12 +323,14 @@ export class ConnectionDialogWidget extends Modal {
|
||||
const controller = new RecentConnectionTreeController(leftClick, actionProvider, this._connectionManagementService, this._contextMenuService);
|
||||
actionProvider.onRecentConnectionRemoved(() => {
|
||||
const recentConnections: ConnectionProfile[] = this._connectionManagementService.getRecentConnections();
|
||||
this.open(recentConnections.length > 0);
|
||||
this.open(recentConnections.length > 0).catch(err => this.logService.error(`Unexpected error opening connection widget after a recent connection was removed from action provider: ${err}`));
|
||||
// We're just using the connections to determine if there are connections to show, dispose them right after to clean up their handlers
|
||||
recentConnections.forEach(conn => conn.dispose());
|
||||
});
|
||||
controller.onRecentConnectionRemoved(() => {
|
||||
const recentConnections: ConnectionProfile[] = this._connectionManagementService.getRecentConnections();
|
||||
this.open(recentConnections.length > 0);
|
||||
this.open(recentConnections.length > 0).catch(err => this.logService.error(`Unexpected error opening connection widget after a recent connection was removed from controller : ${err}`));
|
||||
// We're just using the connections to determine if there are connections to show, dispose them right after to clean up their handlers
|
||||
recentConnections.forEach(conn => conn.dispose());
|
||||
});
|
||||
this._recentConnectionTree = TreeCreationUtils.createConnectionTree(treeContainer, this._instantiationService, controller);
|
||||
@@ -399,7 +401,7 @@ export class ConnectionDialogWidget extends Modal {
|
||||
await TreeUpdateUtils.structuralTreeUpdate(this._recentConnectionTree, 'recent', this._connectionManagementService, this._providers);
|
||||
|
||||
// reset saved connection tree
|
||||
this._savedConnectionTree.setInput([]);
|
||||
await this._savedConnectionTree.setInput([]);
|
||||
|
||||
// call layout with view height
|
||||
this.layout();
|
||||
|
||||
Reference in New Issue
Block a user