Fixing the update issue with backup default name (#15082)

* Fixing the update issue with backup default name

* Avoiding to call select again since that fires an event

* Fixing comment and backup name
This commit is contained in:
Udeesha Gautam
2021-04-30 10:50:26 -07:00
committed by GitHub
parent adbbe7e6b0
commit f2ee8b11b4
2 changed files with 11 additions and 2 deletions

View File

@@ -740,9 +740,10 @@ export class BackupComponent extends AngularDisposable {
}
private setDefaultBackupName(): void {
if (this.backupNameBox && (!this.backupNameBox.value || this.backupNameBox.value.trim().length === 0)) {
const suggestedNamePrefix = this.databaseName + '-' + this.getSelectedBackupType().replace(' ', '-');
if (this.backupNameBox && (!this.backupNameBox.value || this.backupNameBox.value.trim().length === 0 || !this.backupNameBox.value.startsWith(suggestedNamePrefix))) {
let utc = new Date().toJSON().slice(0, 19);
this.backupNameBox.value = this.databaseName + '-' + this.getSelectedBackupType() + '-' + utc;
this.backupNameBox.value = suggestedNamePrefix + '-' + utc;
}
}