Skip to content
Snippets Groups Projects
Commit 87ef3412 authored by Giannis Kopanas's avatar Giannis Kopanas
Browse files

fix the correct series of messages shown in manuscript

parent 34fc7931
No related branches found
No related tags found
No related merge requests found
......@@ -15,13 +15,11 @@ class UploadManuscript extends Component {
}
}
componentDidMount() {
if (this.state.complete === true) {
setTimeout(() => {
this.setState({
complete: false,
})
}, 3000)
componentWillReceiveProps(nextProps) {
if (nextProps.conversion.complete === true) {
this.setState({
complete: true,
})
}
}
......
......@@ -8,6 +8,7 @@ import { generateTitle, extractTitle } from '../lib/title'
export const UPLOAD_MANUSCRIPT_REQUEST = 'UPLOAD_MANUSCRIPT_REQUEST'
export const UPLOAD_MANUSCRIPT_SUCCESS = 'UPLOAD_MANUSCRIPT_SUCCESS'
export const UPLOAD_MANUSCRIPT_FAILURE = 'UPLOAD_MANUSCRIPT_FAILURE'
export const INITIAL_MANUSCRIPT = 'INITIAL_MANUSCRIPT'
/* actions */
......@@ -85,11 +86,13 @@ export const uploadManuscript = (acceptedFiles, history) => dispatch => {
const route = `/projects/${collection.id}/versions/${
fragment.id
}/submit`
// redirect after a short delay
window.setTimeout(() => {
dispatch({
type: INITIAL_MANUSCRIPT,
})
history.push(route)
}, 1000)
}, 2000)
})
},
)
......@@ -105,9 +108,9 @@ export const uploadManuscript = (acceptedFiles, history) => dispatch => {
/* reducer */
const initialState = {
complete: undefined,
complete: false,
converting: false,
error: undefined,
error: false,
}
export default (state = initialState, action) => {
......@@ -119,6 +122,12 @@ export default (state = initialState, action) => {
error: undefined,
}
case INITIAL_MANUSCRIPT:
return {
complete: false,
converting: false,
}
case UPLOAD_MANUSCRIPT_SUCCESS:
return {
complete: true,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment