We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0d9fb9 commit fec9397Copy full SHA for fec9397
src/components/controls/image.tsx
@@ -20,8 +20,9 @@ const ImageControls = ({ options: { maxImageSize = 1024000 } = {} }: IImageContr
20
const f = e.target.files[0];
21
if (!f) return;
22
if (f.size > maxImageSize) {
23
- const kb = maxImageSize / 1024;
24
- window.toast.warning(`Image size should be less than ${kb > 1024 ? `${kb / 1024} MB` : `${kb} KB`}`);
+ const kb = +(maxImageSize / 1024).toFixed(0);
+ window.toast.warning(`Image size should be less than ${kb > 1024 ? `${(kb / 1024).toFixed(0)} MB` : `${kb} KB`}`);
25
+ e.target.value = "";
26
return;
27
}
28
setFile(await toBase64(f));
0 commit comments