Merge pull request #94 from dialmedu/fix/paste-from-clipboard
small fix, check that dataUrls are valid
This commit is contained in:
commit
0449fec242
@ -106,7 +106,9 @@ function ImageUpload({ setReferenceImages }: Props) {
|
|||||||
// Convert images to data URLs and set the prompt images state
|
// Convert images to data URLs and set the prompt images state
|
||||||
Promise.all(files.map((file) => fileToDataURL(file)))
|
Promise.all(files.map((file) => fileToDataURL(file)))
|
||||||
.then((dataUrls) => {
|
.then((dataUrls) => {
|
||||||
setReferenceImages(dataUrls.map((dataUrl) => dataUrl as string));
|
if(dataUrls.length > 0) {
|
||||||
|
setReferenceImages(dataUrls.map((dataUrl) => dataUrl as string));
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// TODO: Display error to user
|
// TODO: Display error to user
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user