react-widget icon indicating copy to clipboard operation
react-widget copied to clipboard

I can't upload another image after I upload a first one

Open kodekaboom opened this issue 4 years ago • 1 comments

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 image 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 avatar Oct 28 '21 19:10 kodekaboom

@kodekaboom Looks like you forgot to set multiple prop to true. It's single mode by default.

nd0ut avatar Mar 11 '22 08:03 nd0ut