Skip to content
Snippets Groups Projects
Commit 0c7475cc authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix(author-list): add correct initial values for author adder

parent 44aaef69
No related branches found
No related tags found
No related merge requests found
......@@ -81,16 +81,23 @@ export default compose(
authorFailure,
},
),
withProps(({ currentUser: { admin, username, email }, authors }) => {
if (!admin && authors.length === 0) {
return {
initialValues: {
email,
firstName: username,
},
withProps(
({
currentUser: { admin, affiliation, firstName, lastName, email },
authors,
}) => {
if (!admin && authors.length === 0) {
return {
initialValues: {
affiliation,
email,
firstName,
lastName,
},
}
}
}
}),
},
),
reduxForm({
form: 'author',
enableReinitialize: 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