Skip to content
Snippets Groups Projects
Commit 46173d14 authored by Chris Beer's avatar Chris Beer
Browse files

Add new manifests to the top of the list

parent 75c1a98b
Branches
Tags
No related merge requests found
import manifesto from 'manifesto.js'; import manifesto from 'manifesto.js';
import omit from 'lodash/omit';
import ActionTypes from '../actions/action-types'; import ActionTypes from '../actions/action-types';
/** /**
...@@ -8,12 +9,12 @@ export const manifestsReducer = (state = {}, action) => { ...@@ -8,12 +9,12 @@ export const manifestsReducer = (state = {}, action) => {
switch (action.type) { switch (action.type) {
case ActionTypes.REQUEST_MANIFEST: case ActionTypes.REQUEST_MANIFEST:
return { return {
...state,
[action.manifestId]: { [action.manifestId]: {
...state[action.manifestId], ...state[action.manifestId],
...action.properties, ...action.properties,
id: action.manifestId, id: action.manifestId,
}, },
...omit(state, action.manifestId),
}; };
case ActionTypes.RECEIVE_MANIFEST: case ActionTypes.RECEIVE_MANIFEST:
return { return {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment