Skip to content

Commit

Permalink
Fix(web-react): FileUploader hidden input were not added without meta
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelklibani committed Nov 8, 2023
1 parent ea9f333 commit 4bb4b21
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const useFileUploaderAttachment = ({
onError,
}: UseFileUploaderAttachmentProps) => {
useIsomorphicLayoutEffect(() => {
const createAttachmentInput = (metadata: FileMetadata) => {
const createAttachmentInput = (metadata?: FileMetadata) => {
attachmentRef.current?.querySelectorAll('input').forEach((element) => element.remove());
const attachmentInputElement = getAttachmentInput(file, name, onError);
attachmentInputElement && attachmentRef.current?.appendChild(attachmentInputElement);
Expand All @@ -30,6 +30,6 @@ export const useFileUploaderAttachment = ({
}
};

meta && createAttachmentInput(meta);
createAttachmentInput(meta);
}, [attachmentRef, file, name, meta, onError]);
};

0 comments on commit 4bb4b21

Please sign in to comment.