Merge pull request #3245 from michael-genson/fix/missing-name-in-timeline-event

fix: Missing Name in Timeline Event
This commit is contained in:
boc-the-git 2024-03-05 16:48:44 +11:00 committed by GitHub
commit 2e7078e90b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,8 +132,7 @@ export default defineComponent({
const { $auth, i18n } = useContext(); const { $auth, i18n } = useContext();
const domMadeThisForm = ref<VForm>(); const domMadeThisForm = ref<VForm>();
const newTimelineEvent = ref<RecipeTimelineEventIn>({ const newTimelineEvent = ref<RecipeTimelineEventIn>({
// @ts-expect-error - TS doesn't like the $auth global user attribute subject: "",
subject: i18n.tc("recipe.user-made-this", { user: $auth.user.fullName }),
eventType: "comment", eventType: "comment",
eventMessage: "", eventMessage: "",
timestamp: undefined, timestamp: undefined,
@ -178,6 +177,8 @@ export default defineComponent({
} }
newTimelineEvent.value.recipeId = props.recipe.id newTimelineEvent.value.recipeId = props.recipe.id
// @ts-expect-error - TS doesn't like the $auth global user attribute
newTimelineEvent.value.subject = i18n.t("recipe.user-made-this", { user: $auth.user.fullName })
// the user only selects the date, so we set the time to end of day local time // the user only selects the date, so we set the time to end of day local time
// we choose the end of day so it always comes after "new recipe" events // we choose the end of day so it always comes after "new recipe" events