From 1c7fe43643ce9d4d20181e38e52565a8ea8c81fa Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Tue, 6 Mar 2018 17:55:43 -0500 Subject: [PATCH] fix editorial workflow load failure --- src/reducers/editorialWorkflow.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reducers/editorialWorkflow.js b/src/reducers/editorialWorkflow.js index f87e9aca..7642f315 100644 --- a/src/reducers/editorialWorkflow.js +++ b/src/reducers/editorialWorkflow.js @@ -20,10 +20,10 @@ import { } from 'Actions/editorialWorkflow'; import { CONFIG_SUCCESS } from 'Actions/config'; -const unpublishedEntries = (state = null, action) => { - const publishMode = action.payload && action.payload.publish_mode; +const unpublishedEntries = (state = Map(), action) => { switch (action.type) { case CONFIG_SUCCESS: + const publishMode = action.payload && action.payload.get('publish_mode'); if (publishMode === EDITORIAL_WORKFLOW) { // Editorial workflow state is explicetelly initiated after the config. return Map({ entities: Map(), pages: Map() }); @@ -31,7 +31,7 @@ const unpublishedEntries = (state = null, action) => { return state; case UNPUBLISHED_ENTRY_REQUEST: return state.setIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`, 'isFetching'], true); - + case UNPUBLISHED_ENTRY_REDIRECT: return state.deleteIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`]);