Skip to content

Commit

Permalink
rev
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Sep 30, 2024
1 parent 03ddd2b commit 55ac13a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/svelte/src/lib/component/UploadDropzone.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@
$: ready = fileTypes.length > 0;
const onUploadClick = (e: MouseEvent) => {
if (state === "uploading") {
e.preventDefault();
e.stopPropagation();
acRef.abort();
acRef = new AbortController();
return;
}
if (mode === "manual" && files.length > 0) {
e.preventDefault();
e.stopPropagation();
uploadFiles(files);
}
};
onMount(() => {
if (!appendOnPaste) return;
Expand Down Expand Up @@ -254,22 +269,7 @@
styleFieldToClassName(appearance?.button, styleFieldArg),
)}
style={styleFieldToClassName(appearance?.button, styleFieldArg)}
on:click={(e) => {
if (state === "uploading") {
e.preventDefault();
e.stopPropagation();
acRef.abort();
acRef = new AbortController();
return;
}
if (mode === "manual" && files.length > 0) {
e.preventDefault();
e.stopPropagation();
uploadFiles(files);
}
}}
on:click={onUploadClick}
data-ut-element="button"
data-state={state}
type="button"
Expand Down

0 comments on commit 55ac13a

Please sign in to comment.