Fix notebook connection dropdown opening multiple connection dialogs (#14283)

This commit is contained in:
Charles Gagnon
2021-02-12 16:42:27 -08:00
committed by GitHub
parent 35c8a20eb3
commit 6a09d8387e

View File

@@ -451,8 +451,10 @@ export class AttachToDropdown extends SelectBox {
}
public doChangeContext(connection?: ConnectionProfile, hideErrorMessage?: boolean): void {
if (this.value === msgChangeConnection || this.value === msgSelectConnection) {
if (this.value === msgChangeConnection) {
this.openConnectionDialog().catch(err => this._notificationService.error(getErrorMessage(err)));
} else if (this.value === msgSelectConnection) {
// no-op, select connection is the default option and so shouldn't have any action done when selected (which only happens if a user cancels out of the connection dialog)
} else {
this.model.changeContext(this.value, connection, hideErrorMessage).catch(err => this._notificationService.error(getErrorMessage(err)));
}