updateSource reducer needs to return an array

pull/10616/head
Jade McGough 2016-12-06 12:06:31 -08:00
parent 59e3c3e045
commit 84161fe792
1 changed files with 2 additions and 3 deletions

View File

@ -7,9 +7,8 @@ export default function sources(state = [], action) {
case 'SOURCE_UPDATED': {
const {source} = action.payload;
const updatedIndex = state.findIndex((s) => s.id === source.id);
const updatedSources = Object.assign({}, state, {
[updatedIndex]: source,
});
const updatedSources = Object.assign([], state);
updatedSources[updatedIndex] = source;
return updatedSources;
}