mirror of
https://github.com/bitwarden/jslib
synced 2025-12-10 21:33:17 +00:00
[bug] Set a default value for custom send deletion times in the safari 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
This commit is contained in:
@@ -183,6 +183,12 @@ export class EffluxDatesComponent implements OnInit {
|
|||||||
return this.safariTimePresetOptions(DateField.ExpriationDate);
|
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,
|
constructor(protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
|
||||||
protected datePipe: DatePipe) {
|
protected datePipe: DatePipe) {
|
||||||
}
|
}
|
||||||
@@ -244,6 +250,15 @@ export class EffluxDatesComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.selectedDeletionDatePreset.setValue(DatePreset.SevenDays);
|
this.selectedDeletionDatePreset.setValue(DatePreset.SevenDays);
|
||||||
this.selectedExpirationDatePreset.setValue(DatePreset.Never);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user