Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
[bug] Set a default value for custom send deletion times in the safar…
Browse files Browse the repository at this point in the history
…i extension (#511)

* [bug] Set a default value for custom send deletion times in the safari extension

* [review] tomorrow -> nextWeek for default custom send deletion time values
  • Loading branch information
Addison Beck committed Oct 8, 2021
1 parent 64bc115 commit e69425c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions angular/src/components/send/efflux-dates.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ export class EffluxDatesComponent implements OnInit {
return this.safariTimePresetOptions(DateField.ExpriationDate);
}

private get nextWeek(): Date {
const nextWeek = new Date();
nextWeek.setDate(nextWeek.getDate() + 7);
return nextWeek;
}

constructor(protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
protected datePipe: DatePipe) {
}
Expand Down Expand Up @@ -244,6 +250,15 @@ export class EffluxDatesComponent implements OnInit {
} else {
this.selectedDeletionDatePreset.setValue(DatePreset.SevenDays);
this.selectedExpirationDatePreset.setValue(DatePreset.Never);

switch (this.browserPath) {
case BrowserPath.Safari:
this.fallbackDeletionDate.setValue(this.nextWeek.toISOString().slice(0, 10));
this.fallbackDeletionTime.setValue(this.safariTimePresetOptions(DateField.DeletionDate)[1].twentyFourHour);
break;
default:
break;
}
}
}

Expand Down

0 comments on commit e69425c

Please sign in to comment.