react-widget
react-widget copied to clipboard
I can't upload another image after I upload a first one
Hi, after I complete the whole process to upload a picture, If I tried to add a new image, doesn't add the other image. shows up the modal, I can select the image, I click the Add button but doesn't work, thanks
the widget configuration
part of the code
` const widgetApi = useRef();
const openDialog = () => { if (widgetApi.current) { widgetApi.current.openDialog(); } };
const onFileSelect = async (selectedFiles) => { if (selectedFiles) { const files = selectedFiles.files();
files.map((file) => {
file.progress(() => {
setIsLoading(true);
});
file.done((info) => {
fetch(info.cdnUrl).then((res) => res.blob()).then((blob) => {
// uploading blob to storage
}).catch((error) => {
console.error(error);
setIsLoading(false);
});
});
});
}
}; `
- Library version:1.3.2
- Language/framework version: React
- OS version: Ubuntu
@kodekaboom Looks like you forgot to set multiple prop to true. It's single mode by default.