Reset file input on publishing when accessing since it can be restored to previous value. (#6855)
This commit is contained in:
parent
618b9a4d3e
commit
57ac473b00
1 changed files with 9 additions and 0 deletions
|
@ -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 (
|
||||
<div className="main--empty">
|
||||
|
|
Loading…
Reference in a new issue