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 e69ef06 commit c0554ccCopy full SHA for c0554cc
src/ui/chat-interface.tsx
@@ -44,8 +44,18 @@ export default function ChatInterface({
44
45
const handleImageUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
46
const file = e.target.files?.[0];
47
- if (file && onImageUpload) {
48
- onImageUpload(file);
+ if (file) {
+ // Check file size (10MB = 10 * 1024 * 1024 bytes)
49
+ const maxSize = 10 * 1024 * 1024; // 10MB in bytes
50
+ if (file.size > maxSize) {
51
+ alert("Image size cannot exceed 10MB. Please choose a smaller image.");
52
+ e.target.value = "";
53
+ return;
54
+ }
55
+
56
+ if (onImageUpload) {
57
+ onImageUpload(file);
58
59
}
60
// Reset the input value so the same file can be selected again
61
e.target.value = "";
0 commit comments