diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index eac23885b..bf48a1907 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -547,6 +547,15 @@ function PublishForm(props: Props) { } }, [autoSwitchMode, editingURI, fileMimeType, myClaimForUri, mode, setMode, setAutoSwitchMode]); + // When accessing to publishing, make sure to reset file input attributes + // since we can't restore from previous user selection (like we do + // with other properties such as name, title, etc.) for security reasons. + useEffect(() => { + if (mode === PUBLISH_MODES.FILE) { + updatePublishForm({ filePath: '', fileDur: 0, fileSize: 0 }); + } + }, [mode, updatePublishForm]); + if (publishing) { return (