Skip to content

Commit

Permalink
fix(survey): resolve default meal time on mealAdd
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashroch committed Jan 14, 2023
1 parent c8c4ab1 commit b57b610
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/survey/src/stores/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,14 @@ export const useSurvey = defineStore('survey', {
},

addMeal(name: string, locale: string) {
const defaultTime = toMealTime(
this.defaultSchemeMeals?.find((meal) => meal.name[locale] === name)?.time ?? '8:00'
);

this.data.meals.push({
id: this.getNextMealId(),
name: { en: name, [locale]: name },
defaultTime: { hours: 0, minutes: 0 },
defaultTime,
time: undefined,
flags: [],
foods: [],
Expand Down

0 comments on commit b57b610

Please sign in to comment.