309 invalid video #362

Merged
bones7242 merged 2 commits from 309-invalid-video into master 2018-02-26 02:50:34 +01:00
3 changed files with 9 additions and 13 deletions
Showing only changes of commit d4fabe3473 - Show all commits

View file

@ -12,14 +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));
},
};
};

View file

@ -74,11 +74,11 @@ 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 () {

View file

@ -1,6 +1,5 @@
import {connect} from 'react-redux';
import {clearFile, selectFile, updateError, updatePublishStatus} from 'actions/publish';
import {updateLoggedInChannel} from 'actions/channel';
import {clearFile, updateError, updatePublishStatus} from 'actions/publish';
import View from './view';
const mapStateToProps = ({ channel, publish }) => {
@ -23,15 +22,9 @@ const mapStateToProps = ({ channel, publish }) => {
const mapDispatchToProps = dispatch => {
return {
onFileSelect: (file) => {
dispatch(selectFile(file));
},
onFileClear: () => {
dispatch(clearFile());
},
onChannelLogin: (name, shortId, longId) => {
dispatch(updateLoggedInChannel(name, shortId, longId));
},
onPublishStatusChange: (status, message) => {
dispatch(updatePublishStatus(status, message));
},