diff --git a/frontend/src/components/FileField.tsx b/frontend/src/components/FileField.tsx index 35bceb8037fa9c06b854f835ecd840a081a93bdd_ZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRmlsZUZpZWxkLnRzeA==..c721fa8511f627b5905b10924983566d3243e1f6_ZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRmlsZUZpZWxkLnRzeA== 100644 --- a/frontend/src/components/FileField.tsx +++ b/frontend/src/components/FileField.tsx @@ -37,16 +37,10 @@ const onFileChange: ChangeEventHandler<HTMLInputElement> = (e) => { if (e.target.files && e.target.files.length > 0 && onChange) { const file = e.target.files[0]; - if (value) { - onChange({ - ...value, - data: file, - }); - } else { - onChange({ - data: file, - }); - } + onChange({ + data: file, + updateKey: value?.updateKey !== undefined ? value.updateKey + 1 : 0, + }); } }; @@ -50,6 +44,16 @@ } }; + function getFileName() { + if (value?.data) { + return `(${value.data.name})`; + } + if (value?.downloadUrl) { + return `(${getFileNameFromURL(value?.downloadUrl)})`; + } + return ""; + } + const filePresent = value?.downloadUrl || value?.data; return (