diff --git a/src/components/Epochs.js b/src/components/Epochs.js index 23e9cc1..8a37255 100644 --- a/src/components/Epochs.js +++ b/src/components/Epochs.js @@ -18,14 +18,19 @@ const Epochs = props => { const removeEpoch = (e, epochName) => { e.preventDefault() - let newEpochs = props.epochs.filter(epoch => epoch.name !== epochName); - props.setEpochs(newEpochs) + props.dispatch({ + type: 'REMOVE_EPOCH', + value: {name: epochName} + }); } const updateEpoch = (epoch, epochIndex) => { let updatedEpochs = [...props.epochs] updatedEpochs[epochIndex] = epoch - props.setEpochs(updatedEpochs) + props.dispatch({ + type: "SET_EPOCH", + value: epoch + }) } return ( diff --git a/src/components/SoundChangeSuite.js b/src/components/SoundChangeSuite.js index 34e04f0..59abeef 100644 --- a/src/components/SoundChangeSuite.js +++ b/src/components/SoundChangeSuite.js @@ -23,9 +23,6 @@ const SoundChangeSuite = props => { )} > - {props.error - ?

{`Formatting errors in line(s) ${props.error.join(', ')}`}

- : <>}