diff --git a/resources/js/components/SMInputAttachments.vue b/resources/js/components/SMInputAttachments.vue index e25fc61..b17b4c1 100644 --- a/resources/js/components/SMInputAttachments.vue +++ b/resources/js/components/SMInputAttachments.vue @@ -65,14 +65,18 @@ const mediaItems: Ref = ref([]); * Handle the user adding a new media item. */ const handleClickAdd = async () => { - openDialog(SMDialogMedia, { mime: "", accepts: "" }).then((result) => { - const media = result as Media; + openDialog(SMDialogMedia, { mime: "", accepts: "" }) + .then((result) => { + const media = result as Media; - mediaItems.value.push(media); - value.value.push(media.id); + mediaItems.value.push(media); + value.value.push(media.id); - emits("update:modelValue", value); - }); + emits("update:modelValue", value); + }) + .catch(() => { + /* empty */ + }); }; /** diff --git a/resources/js/helpers/transition.ts b/resources/js/helpers/transition.ts index 15094bf..7230a89 100644 --- a/resources/js/helpers/transition.ts +++ b/resources/js/helpers/transition.ts @@ -66,25 +66,29 @@ const waitForElementRender = (elem: Ref): Promise => { * @returns {void} */ export const transitionEnter = (elem: Ref, transition: string): void => { - waitForElementRender(elem).then((e: HTMLElement) => { - window.setTimeout(() => { - e.classList.replace( - transition + "-enter-from", - transition + "-enter-active" - ); - const transitionName = transitionEndEventName(); - e.addEventListener( - transitionName, - () => { - e.classList.replace( - transition + "-enter-active", - transition + "-enter-to" - ); - }, - false - ); - }, 1); - }); + waitForElementRender(elem) + .then((e: HTMLElement) => { + window.setTimeout(() => { + e.classList.replace( + transition + "-enter-from", + transition + "-enter-active" + ); + const transitionName = transitionEndEventName(); + e.addEventListener( + transitionName, + () => { + e.classList.replace( + transition + "-enter-active", + transition + "-enter-to" + ); + }, + false + ); + }, 1); + }) + .catch(() => { + /* empty */ + }); }; /**