1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

set Send date presets to Custom if editing a send (#997)

This commit is contained in:
Addison Beck 2021-07-21 12:43:40 -04:00 committed by GitHub
parent 0682269e34
commit d7287e7aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,12 +26,14 @@ export class EffluxDatesComponent extends BaseEffluxDatesComponent implements On
// We reuse the same form on desktop and just swap content, so need to watch these to maintin proper values. // We reuse the same form on desktop and just swap content, so need to watch these to maintin proper values.
ngOnChanges() { ngOnChanges() {
this.selectedExpirationDatePreset.setValue(0);
this.selectedDeletionDatePreset.setValue(0);
this.defaultDeletionDateTime.setValue(this.datePipe.transform(new Date(this.initialDeletionDate), 'yyyy-MM-ddTHH:mm'));
if (this.initialExpirationDate) { if (this.initialExpirationDate) {
this.defaultExpirationDateTime.setValue( this.defaultExpirationDateTime.setValue(
this.datePipe.transform(new Date(this.initialExpirationDate), 'yyyy-MM-ddTHH:mm')); this.datePipe.transform(new Date(this.initialExpirationDate), 'yyyy-MM-ddTHH:mm'));
} else { } else {
this.defaultExpirationDateTime.setValue(null); this.defaultExpirationDateTime.setValue(null);
} }
this.defaultDeletionDateTime.setValue(this.datePipe.transform(new Date(this.initialDeletionDate), 'yyyy-MM-ddTHH:mm'));
} }
} }