From 6a09d8387ed901322417b222a67788bd3ae73ddf Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Fri, 12 Feb 2021 16:42:27 -0800 Subject: [PATCH] Fix notebook connection dropdown opening multiple connection dialogs (#14283) --- src/sql/workbench/contrib/notebook/browser/notebookActions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts index 382407bf23..2021ff18e5 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts @@ -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))); }