fixed bug where waiting on the confirm screen could place the first step into the past
This commit is contained in:
parent
196f2f1d97
commit
d6fb1403de
1 changed files with 9 additions and 0 deletions
|
@ -170,6 +170,15 @@ class AddPizzaEventPageState extends State<AddPizzaEventPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
// if the user waited to long on the confirmation dialog that the first step time is now in the past
|
||||
var durationUntilFirstStep = Duration(seconds: this.widget.pizzaRecipe.getCurrentDuration().inSeconds);
|
||||
var firstStepDateTime = eventTime.subtract(durationUntilFirstStep);
|
||||
if (firstStepDateTime.isBefore(DateTime.now())){
|
||||
eventTime = DateTime.now()
|
||||
.add(durationUntilFirstStep)
|
||||
.add(const Duration(minutes: 1));
|
||||
}
|
||||
|
||||
var pizzaEventsBox = Hive.box<PizzaEvent>("PizzaEvents");
|
||||
PizzaEvent pizzaEvent = PizzaEvent(
|
||||
this.name,
|
||||
|
|
Loading…
Add table
Reference in a new issue