diff --git a/extensions/sql-migration/src/wizard/targetSelectionPage.ts b/extensions/sql-migration/src/wizard/targetSelectionPage.ts index 9ac75c2803..3f89fdf00a 100644 --- a/extensions/sql-migration/src/wizard/targetSelectionPage.ts +++ b/extensions/sql-migration/src/wizard/targetSelectionPage.ts @@ -266,16 +266,12 @@ export class TargetSelectionPage extends MigrationWizardPage { this.migrationStateModel._resourceGroup = undefined!; this.migrationStateModel._targetServerInstance = undefined!; - const clearDropDown = async (dropDown: azdata.DropDownComponent): Promise => { - dropDown.values = []; - dropDown.value = undefined; - }; - await clearDropDown(this._azureAccountsDropdown); - await clearDropDown(this._accountTenantDropdown); - await clearDropDown(this._azureSubscriptionDropdown); - await clearDropDown(this._azureLocationDropdown); - await clearDropDown(this._azureResourceGroupDropdown); - await clearDropDown(this._azureResourceDropdown); + this._clearDropDown(this._azureAccountsDropdown); + this._clearDropDown(this._accountTenantDropdown); + this._clearDropDown(this._azureSubscriptionDropdown); + this._clearDropDown(this._azureLocationDropdown); + this._clearDropDown(this._azureResourceGroupDropdown); + this._clearDropDown(this._azureResourceDropdown); } await this.populateAzureAccountsDropdown(); @@ -416,6 +412,7 @@ export class TargetSelectionPage extends MigrationWizardPage { : undefined!; this.migrationStateModel.refreshDatabaseBackupPage = true; } + this._clearDropDown(this._azureLocationDropdown); await this.populateLocationDropdown(); })); @@ -446,6 +443,7 @@ export class TargetSelectionPage extends MigrationWizardPage { : undefined!; } this.migrationStateModel.refreshDatabaseBackupPage = true; + this._clearDropDown(this._azureResourceGroupDropdown); await this.populateResourceGroupDropdown(); })); @@ -672,6 +670,7 @@ export class TargetSelectionPage extends MigrationWizardPage { ? utils.deepClone(selectedResourceGroup)! : undefined!; } + this._clearDropDown(this._azureResourceDropdown); await this.populateResourceInstanceDropdown(); })); @@ -1208,4 +1207,9 @@ export class TargetSelectionPage extends MigrationWizardPage { targetDatabaseCollation.length > 0 && sourceDatabaseCollation.toLocaleLowerCase() === targetDatabaseCollation.toLocaleLowerCase(); } + + private _clearDropDown(dropDown: azdata.DropDownComponent): void { + dropDown.values = []; + dropDown.value = undefined; + } }