diff --git a/react/containers/Dropzone.jsx b/react/containers/Dropzone.jsx index 59dc8a16..23d6a2c6 100644 --- a/react/containers/Dropzone.jsx +++ b/react/containers/Dropzone.jsx @@ -152,6 +152,7 @@ const mapDispatchToProps = dispatch => { return { onFileSelect: (file) => { dispatch(selectFile(file)); + dispatch(updateError('publishSubmit', null)); }, onFileError: (value) => { dispatch(updateError('file', value)); diff --git a/react/containers/PublishForm.jsx b/react/containers/PublishForm.jsx index cfb5cad2..94e88658 100644 --- a/react/containers/PublishForm.jsx +++ b/react/containers/PublishForm.jsx @@ -125,13 +125,13 @@ class PublishForm extends React.Component { .then(() => { const metadata = that.createMetadata(); // publish the claim - return that.makePublishRequest(this.props.file, metadata); + return that.makePublishRequest(that.props.file, metadata); }) .then(() => { that.props.onPublishStatusChange('publish request made'); }) .catch((error) => { - that.props.onPublishRequestError(error.message); + that.props.onPublishSubmitError(error.message); }); } render () { @@ -174,8 +174,8 @@ class PublishForm extends React.Component { -
-

{this.props.publishRequestError}

+
+

{this.props.publishSubmitError}

@@ -196,18 +196,18 @@ class PublishForm extends React.Component { const mapStateToProps = state => { return { - file : state.file, - claim : state.claim, - title : state.metadata.title, - thumbnail : state.metadata.thumbnail, - description : state.metadata.description, - license : state.metadata.license, - nsfw : state.metadata.nsfw, - loggedInChannel : state.loggedInChannel, - publishInChannel : state.publishInChannel, - fileError : state.error.file, - urlError : state.error.url, - publishRequestError: state.error.publishRequest, + file : state.file, + claim : state.claim, + title : state.metadata.title, + thumbnail : state.metadata.thumbnail, + description : state.metadata.description, + license : state.metadata.license, + nsfw : state.metadata.nsfw, + loggedInChannel : state.loggedInChannel, + publishInChannel : state.publishInChannel, + fileError : state.error.file, + urlError : state.error.url, + publishSubmitError: state.error.publishSubmit, }; }; @@ -225,8 +225,8 @@ const mapDispatchToProps = dispatch => { onPublishStatusChange: (status, message) => { dispatch(updatePublishStatus(status, message)); }, - onPublishRequestError: (value) => { - dispatch(updateError('publishRequest', value)); + onPublishSubmitError: (value) => { + dispatch(updateError('publishSubmit', value)); }, }; }; @@ -243,12 +243,12 @@ PublishForm.propTypes = { publishInChannel : PropTypes.bool.isRequired, fileError : PropTypes.string, urlError : PropTypes.string, - publishRequestError : PropTypes.string, + publishSubmitError : PropTypes.string, onFileSelect : PropTypes.func.isRequired, onFileClear : PropTypes.func.isRequired, onChannelLogin : PropTypes.func.isRequired, onPublishStatusChange: PropTypes.func.isRequired, - onPublishRequestError: PropTypes.func.isRequired, + onPublishSubmitError: PropTypes.func.isRequired, }; export default connect(mapStateToProps, mapDispatchToProps)(PublishForm); diff --git a/react/containers/PublishMetadataInputs.jsx b/react/containers/PublishMetadataInputs.jsx index d2ed7934..f4317145 100644 --- a/react/containers/PublishMetadataInputs.jsx +++ b/react/containers/PublishMetadataInputs.jsx @@ -45,42 +45,39 @@ class MetadataInputs extends React.Component { } render () { return ( -
-
- {this.state.showInputs ? '[less]' : '[more]'} -
- {this.state.showInputs && ( -
- -
-
- -
-