diff --git a/apps/dashboard/src/lib/components/UploadWidget/index.svelte b/apps/dashboard/src/lib/components/UploadWidget/index.svelte index 2d6160d7..21fb1ab3 100644 --- a/apps/dashboard/src/lib/components/UploadWidget/index.svelte +++ b/apps/dashboard/src/lib/components/UploadWidget/index.svelte @@ -33,6 +33,8 @@ }[] = []; let fileInput: HTMLInputElement; + let label = "Upload Image" + const onChange = (tabValue: string) => () => (currentTab = tabValue); async function handleImageClick(img: string) { @@ -42,6 +44,12 @@ const onFileSelected = () => { const file = fileInput?.files?.[0]; + const sizeInkb = file?.size! / 1024; + if (sizeInkb > 500){ + snackbar.error("File Size must not be greater than 500kb") + label = "Try Again" + return; + } if (file) { let reader = new FileReader(); reader.readAsDataURL(file); @@ -109,7 +117,7 @@ disabled={isUploading} /> Images wider than 1500 pixels work best.

-

The maximum size per file is 5 MB.

+

The maximum size per file is 500kb.