diff --git a/components/calendar/form/DeleteEvent.vue b/components/calendar/form/DeleteEvent.vue index 0892603..97a2f59 100644 --- a/components/calendar/form/DeleteEvent.vue +++ b/components/calendar/form/DeleteEvent.vue @@ -12,8 +12,6 @@ const formErrors = reactive<{ message: string | null }>({ watch(isDeleteEventModalOpen, (hasOpened, _o) => { if (hasOpened && lastActiveEvent.value) { eventSkeleton.value = { ...lastActiveEvent.value } - } else { - resetSkeleton() } }) @@ -26,6 +24,8 @@ async function handleAction() { if (err instanceof Error) { formErrors.message = err.message } + } finally { + resetSkeleton() } } diff --git a/components/calendar/form/UpdateEvent.vue b/components/calendar/form/UpdateEvent.vue index 03f3f7d..08d5d28 100644 --- a/components/calendar/form/UpdateEvent.vue +++ b/components/calendar/form/UpdateEvent.vue @@ -15,8 +15,6 @@ const formErrors = reactive<{ message: string | null }>({ watch(isEditEventModalOpen, (hasOpened, _o) => { if (hasOpened && lastActiveEvent.value) { eventSkeleton.value = { ...lastActiveEvent.value } - } else { - resetSkeleton() } }) @@ -29,6 +27,8 @@ async function handleAction() { if (err instanceof Error) { formErrors.message = err.message } + } finally { + resetSkeleton() } }