mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -05:00
Fix restore dialog null references (#20096)
* Fix restore dialog null references * Make database field optional like other properties in viewmodel class
This commit is contained in:
@@ -287,7 +287,7 @@ export class RestoreDialog extends Modal {
|
||||
ariaLabel: LocalizedStrings.TARGETDATABASE,
|
||||
placeholder: localize('targetDatabaseTooltip', "Please enter target database name"),
|
||||
validationOptions: {
|
||||
validation: (value: string) => this.viewModel.databases.includes(value) ? ({ type: MessageType.ERROR, content: localize('restoreDialog.targetDatabaseAlreadyExists', "Target database already exists") }) : null
|
||||
validation: (value: string) => this.viewModel.databases?.includes(value) ? ({ type: MessageType.ERROR, content: localize('restoreDialog.targetDatabaseAlreadyExists', "Target database already exists") }) : null
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -666,7 +666,7 @@ export class RestoreDialog extends Modal {
|
||||
this._register(attachTableStyler(this._restorePlanTable!, this._themeService));
|
||||
|
||||
this._register(this._targetDatabaseInputBox.onDidChange(dbName => {
|
||||
if (!this.viewModel.databases.includes(dbName)) {
|
||||
if (!this.viewModel.databases?.includes(dbName)) {
|
||||
if (this.viewModel.targetDatabaseName !== dbName) {
|
||||
this.viewModel.targetDatabaseName = dbName;
|
||||
this.validateRestore();
|
||||
|
||||
@@ -48,7 +48,7 @@ export class RestoreViewModel {
|
||||
public selectedBackupSets?: string[];
|
||||
public defaultBackupFolder?: string;
|
||||
public deviceType?: MediaDeviceType;
|
||||
public databases: string[];
|
||||
public databases?: string[];
|
||||
|
||||
private _onSetLastBackupTaken = new Emitter<string>();
|
||||
public onSetLastBackupTaken: Event<string> = this._onSetLastBackupTaken.event;
|
||||
|
||||
Reference in New Issue
Block a user