Open
Description
The app's current mealState
is stored in cookies, which persist after meals. Therefore, if one meal finishes and the user closes the app, when they re-open the app for the next meal it will still be in PostMeal
. However, we want it to start in PreMeal
.
One way of addressing it is to have the app store the timestamp of the last state transition in global state. Then, before rendering either App.jsx
or Home.jsx
(TBD -- the assignee of this issue can make an informed decision about which) the app checks whether it is in PoseMeal and more than some time (2 mins?) has passed between the last state changed time and the current time. If so it changes the mealState from PostMeal to PreMeal.