From 06799a90b0ed130bd580094592b5d61efa3b622b Mon Sep 17 00:00:00 2001 From: James Collins Date: Tue, 29 Aug 2023 14:54:40 +1000 Subject: [PATCH] bug fixes --- resources/js/components/SMDialog.ts | 6 ++---- resources/js/components/dialogs/SMDialogUpload.vue | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/js/components/SMDialog.ts b/resources/js/components/SMDialog.ts index 105dffe..c8fcc88 100644 --- a/resources/js/components/SMDialog.ts +++ b/resources/js/components/SMDialog.ts @@ -43,7 +43,6 @@ export default defineComponent({ /** * Closes last opened dialog, resolving the promise with the return value of the dialog, or with the given * data if any. - * * @param {unknown} data The dialog return value. */ export function closeDialog(data?: unknown) { @@ -53,7 +52,7 @@ export function closeDialog(data?: unknown) { } const lastDialog = dialogRefs.pop(); - if (data === undefined) { + if (data === undefined && lastDialog.comp) { data = lastDialog.comp.returnValue(); } if (lastDialog) { @@ -89,7 +88,6 @@ type ReturnType = BindingReturnType; /** * Opens a dialog. - * * @param {Component} dialog The dialog you want to open. * @param {PropsType} props The props to be passed to the dialog. * @param {string} wrapper The dialog wrapper you want the dialog to open into. @@ -98,7 +96,7 @@ type ReturnType = BindingReturnType; export function openDialog( dialog: C, props?: PropsType, - wrapper: string = "default" + wrapper: string = "default", ): Promise> { if (dialogRefs.length === 0) { document.getElementsByTagName("html")[0].style.overflow = "hidden"; diff --git a/resources/js/components/dialogs/SMDialogUpload.vue b/resources/js/components/dialogs/SMDialogUpload.vue index ada34eb..c0e56e5 100644 --- a/resources/js/components/dialogs/SMDialogUpload.vue +++ b/resources/js/components/dialogs/SMDialogUpload.vue @@ -175,6 +175,7 @@ const handleChangeSelectFile = async () => { } else { const offset = chunk * chunkSize; const fileChunk = file.slice(offset, offset + chunkSize); + submitFormData.append("id", resultMedia.id); submitFormData.append("file", fileChunk); submitFormData.append("chunk", (chunk + 1).toString()); submitFormData.append("chunk_count", chunkCount.toString());