Skip to content
Snippets Groups Projects
Commit 338c8dc9 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

fix(components): fix delete file and 409 workaround

parent 47898943
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ import { reduxForm, formValueSelector, SubmissionError } from 'redux-form' ...@@ -8,6 +8,7 @@ import { reduxForm, formValueSelector, SubmissionError } from 'redux-form'
import WizardStep from './WizardStep' import WizardStep from './WizardStep'
import { autosaveRequest } from '../redux/autosave' import { autosaveRequest } from '../redux/autosave'
let cachedVersion = ''
const wizardSelector = formValueSelector('wizard') const wizardSelector = formValueSelector('wizard')
const onChange = ( const onChange = (
...@@ -19,7 +20,8 @@ const onChange = ( ...@@ -19,7 +20,8 @@ const onChange = (
const prev = pick(prevValues, formSectionKeys) const prev = pick(prevValues, formSectionKeys)
const newValues = pick(values, formSectionKeys) const newValues = pick(values, formSectionKeys)
// TODO: fix this if it sucks down the road // TODO: fix this if it sucks down the road
if (!isEqual(prev, newValues)) { if (!isEqual(prev, newValues) && cachedVersion !== version.rev) {
cachedVersion = version.rev
dispatch(autosaveRequest()) dispatch(autosaveRequest())
dispatch( dispatch(
actions.updateFragment(project, { actions.updateFragment(project, {
......
...@@ -189,7 +189,7 @@ export default compose( ...@@ -189,7 +189,7 @@ export default compose(
...files, ...files,
[type]: files[type].filter(f => f.id !== id), [type]: files[type].filter(f => f.id !== id),
} }
setFiles(newFiles, type) setFiles(newFiles)
changeForm('wizard', 'files', files) changeForm('wizard', 'files', files)
}, },
}), }),
......
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