Commit c2d4f187 authored by Oleksii Savran's avatar Oleksii Savran

Merge branch...

Merge branch '596-response-data-error-if-user-create-new-version-of-dataset-and-makes-changes-on-the-first-step' into 'master'

Fix: `response.data.error` if user create new version of dataset and makes...

Closes #596

See merge request genesys-pgr/genesys-ui!589
parents 4a7d760f 68094d57
......@@ -182,8 +182,8 @@ class FilesForm extends React.Component<IFilesFormProps, any> {
const mapStateToProps = (state, ownProps) => {
if (state.form[FILES_FORM]) {
const filesFields = [...ownProps.dataset.repositoryFiles];
const lengthWithEmpty = state.form[FILES_FORM].values.repositoryFiles.length;
const filesFields = [...(ownProps.dataset.repositoryFiles || [])];
const lengthWithEmpty = state.form[FILES_FORM].values.repositoryFiles ? state.form[FILES_FORM].values.repositoryFiles.length : 0;
if (filesFields.length < lengthWithEmpty) {
while (filesFields.length !== lengthWithEmpty) {
filesFields.push(new RepositoryFile());
......
Markdown is supported
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