fix editorial workflow load failure
This commit is contained in:
@ -20,10 +20,10 @@ import {
|
|||||||
} from 'Actions/editorialWorkflow';
|
} from 'Actions/editorialWorkflow';
|
||||||
import { CONFIG_SUCCESS } from 'Actions/config';
|
import { CONFIG_SUCCESS } from 'Actions/config';
|
||||||
|
|
||||||
const unpublishedEntries = (state = null, action) => {
|
const unpublishedEntries = (state = Map(), action) => {
|
||||||
const publishMode = action.payload && action.payload.publish_mode;
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case CONFIG_SUCCESS:
|
case CONFIG_SUCCESS:
|
||||||
|
const publishMode = action.payload && action.payload.get('publish_mode');
|
||||||
if (publishMode === EDITORIAL_WORKFLOW) {
|
if (publishMode === EDITORIAL_WORKFLOW) {
|
||||||
// Editorial workflow state is explicetelly initiated after the config.
|
// Editorial workflow state is explicetelly initiated after the config.
|
||||||
return Map({ entities: Map(), pages: Map() });
|
return Map({ entities: Map(), pages: Map() });
|
||||||
@ -31,7 +31,7 @@ const unpublishedEntries = (state = null, action) => {
|
|||||||
return state;
|
return state;
|
||||||
case UNPUBLISHED_ENTRY_REQUEST:
|
case UNPUBLISHED_ENTRY_REQUEST:
|
||||||
return state.setIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`, 'isFetching'], true);
|
return state.setIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`, 'isFetching'], true);
|
||||||
|
|
||||||
case UNPUBLISHED_ENTRY_REDIRECT:
|
case UNPUBLISHED_ENTRY_REDIRECT:
|
||||||
return state.deleteIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`]);
|
return state.deleteIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user