small fix, check that dataUrls are valid, when there is only text on the clipboard
This commit is contained in:
parent
b9522fede2
commit
d177ad30c8
@ -106,7 +106,9 @@ function ImageUpload({ setReferenceImages }: Props) {
|
||||
// Convert images to data URLs and set the prompt images state
|
||||
Promise.all(files.map((file) => fileToDataURL(file)))
|
||||
.then((dataUrls) => {
|
||||
setReferenceImages(dataUrls.map((dataUrl) => dataUrl as string));
|
||||
if(dataUrls.length > 0) {
|
||||
setReferenceImages(dataUrls.map((dataUrl) => dataUrl as string));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
// TODO: Display error to user
|
||||
|
||||
Loading…
Reference in New Issue
Block a user