Skip to content

Commit

Permalink
fix(FileUpload): Check if the file is an image before render it to th…
Browse files Browse the repository at this point in the history
…e list
  • Loading branch information
johan-fx committed Dec 18, 2023
1 parent fe537ef commit 7bbe60c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/src/form/FileUpload/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ const FileUpload = ({
if ('File' in window && file instanceof File && file.type.indexOf('image') >= 0) {
return URL.createObjectURL(file);
}
return file?.url ?? '';
if (file?.url && file?.type?.indexOf('image') >= 0) {
return file.url;
}

return null;
};

return (
Expand Down

0 comments on commit 7bbe60c

Please sign in to comment.