diff --git a/client/src/components/Upload/DragAndDropModal.vue b/client/src/components/Upload/DragAndDropModal.vue index f881cd749876..558f515925d5 100644 --- a/client/src/components/Upload/DragAndDropModal.vue +++ b/client/src/components/Upload/DragAndDropModal.vue @@ -6,7 +6,7 @@ import { computed, ref } from "vue"; import { Toast } from "@/composables/toast"; const modalContentElement = ref(null); -const { isFileOverDocument, isFileOverDropZone } = useFileDrop(modalContentElement, onDrop, onDropFail, true); +const { isFileOverDocument, isFileOverDropZone } = useFileDrop(modalContentElement, onDrop, onDropCancel, true); const modalClass = computed(() => { if (isFileOverDropZone.value) { @@ -29,9 +29,9 @@ function onDrop(event) { } } -function onDropFail(event) { +function onDropCancel(event) { if (event.dataTransfer?.files?.length > 0) { - Toast.error("Please try again", "File failed"); + Toast.error("Please try again", "Upload cancelled"); } } diff --git a/client/src/composables/fileDrop.ts b/client/src/composables/fileDrop.ts index 2dc48db2f8bc..9ffdde5aba9b 100644 --- a/client/src/composables/fileDrop.ts +++ b/client/src/composables/fileDrop.ts @@ -7,14 +7,14 @@ export type FileDropHandler = (event: DragEvent) => void; * Custom File-Drop composable * @param dropZone Element which files should be dropped on * @param onDrop callback function called when drop occurs - * @param onDropFail callback function called when drop fails (missed zone) + * @param onDropCancel callback function called when drop cancelled * @param solo when true, only reacts if no modal is open * @param idleTime how long to wait until state resets */ export function useFileDrop( dropZone: MaybeRefOrGetter, onDrop: Ref | FileDropHandler, - onDropFail: Ref | FileDropHandler, + onDropCancel: Ref | FileDropHandler, solo: MaybeRefOrGetter, idleTime = 800 ) { @@ -75,8 +75,8 @@ export function useFileDrop( const dropHandler = unref(onDrop); dropHandler(event as DragEvent); } else { - const dropFailHandler = unref(onDropFail); - dropFailHandler(event as DragEvent); + const dropCancelHandler = unref(onDropCancel); + dropCancelHandler(event as DragEvent); } return "idle"; case "dragend":