mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
wait for timelime event to finish before closing modal
This commit is contained in:
parent
436a24f8b2
commit
2e63d24e40
1 changed files with 5 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
<div>
|
<div>
|
||||||
<BaseDialog
|
<BaseDialog
|
||||||
v-model="madeThisDialog"
|
v-model="madeThisDialog"
|
||||||
|
:loading="madeThisFormLoading"
|
||||||
:icon="$globals.icons.chefHat"
|
:icon="$globals.icons.chefHat"
|
||||||
:title="$t('recipe.made-this')"
|
:title="$t('recipe.made-this')"
|
||||||
:submit-text="$t('recipe.add-to-timeline')"
|
:submit-text="$t('recipe.add-to-timeline')"
|
||||||
|
@ -196,12 +197,14 @@ export default defineNuxtComponent({
|
||||||
newTimelineEventImagePreviewUrl.value = URL.createObjectURL(fileObject);
|
newTimelineEventImagePreviewUrl.value = URL.createObjectURL(fileObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = reactive({ datePickerMenu: false });
|
const state = reactive({ datePickerMenu: false, madeThisFormLoading: false });
|
||||||
async function createTimelineEvent() {
|
async function createTimelineEvent() {
|
||||||
if (!(newTimelineEventTimestampString.value && props.recipe?.id && props.recipe?.slug)) {
|
if (!(newTimelineEventTimestampString.value && props.recipe?.id && props.recipe?.slug)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.madeThisFormLoading = true;
|
||||||
|
|
||||||
newTimelineEvent.value.recipeId = props.recipe.id;
|
newTimelineEvent.value.recipeId = props.recipe.id;
|
||||||
// Note: $auth.user is now a ref
|
// Note: $auth.user is now a ref
|
||||||
newTimelineEvent.value.subject = i18n.t("recipe.user-made-this", { user: $auth.user.value?.fullName });
|
newTimelineEvent.value.subject = i18n.t("recipe.user-made-this", { user: $auth.user.value?.fullName });
|
||||||
|
@ -236,6 +239,7 @@ export default defineNuxtComponent({
|
||||||
newTimelineEvent.value.timestamp = undefined;
|
newTimelineEvent.value.timestamp = undefined;
|
||||||
clearImage();
|
clearImage();
|
||||||
madeThisDialog.value = false;
|
madeThisDialog.value = false;
|
||||||
|
state.madeThisFormLoading = false;
|
||||||
domMadeThisForm.value?.reset();
|
domMadeThisForm.value?.reset();
|
||||||
|
|
||||||
context.emit("eventCreated", newEvent);
|
context.emit("eventCreated", newEvent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue