diff --git a/react/containers/Dropzone/index.js b/react/containers/Dropzone/index.js index 07cc66e0..1faeb20c 100644 --- a/react/containers/Dropzone/index.js +++ b/react/containers/Dropzone/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { selectFile, updateError } from 'actions/publish'; +import { selectFile, updateError, clearFile } from 'actions/publish'; import View from './view'; const mapStateToProps = ({ publish }) => { @@ -12,13 +12,17 @@ const mapStateToProps = ({ publish }) => { const mapDispatchToProps = dispatch => { return { - onFileSelect: (file) => { + selectFile: (file) => { dispatch(selectFile(file)); dispatch(updateError('publishSubmit', null)); }, - onFileError: (value) => { + setFileError: (value) => { + dispatch(clearFile()); dispatch(updateError('file', value)); }, + clearFileError: () => { + dispatch(updateError('file', null)); + }, }; }; diff --git a/react/containers/Dropzone/view.jsx b/react/containers/Dropzone/view.jsx index 90b7c2a4..be5a9af1 100644 --- a/react/containers/Dropzone/view.jsx +++ b/react/containers/Dropzone/view.jsx @@ -74,20 +74,20 @@ class Dropzone extends React.Component { try { validateFile(file); // validate the file's name, type, and size } catch (error) { - return this.props.onFileError(error.message); + return this.props.setFileError(error.message); } // stage it so it will be ready when the publish button is clicked - this.props.onFileError(null); - this.props.onFileSelect(file); + this.props.clearFileError(null); + this.props.selectFile(file); } } render () { return ( -
Drop it.
-{this.props.fileError}
-Drag & drop image or video here to publish
-OR
-CHOOSE FILE
-Drop it.
+{this.props.fileError}
+Drag & drop image or video here to publish
+OR
+CHOOSE FILE
+Drop it.
+Drop it.
{this.props.fileError}
+{this.props.fileError}
Drag & drop image or video here to publish
-OR
-CHOOSE FILE
+OR
+CHOOSE FILE
By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. Read more.
+By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. Read more.