diff --git a/geonode_mapstore_client/client/js/epics/resourceservice.js b/geonode_mapstore_client/client/js/epics/resourceservice.js index 7498d05347..4c99d79811 100644 --- a/geonode_mapstore_client/client/js/epics/resourceservice.js +++ b/geonode_mapstore_client/client/js/epics/resourceservice.js @@ -66,7 +66,8 @@ const processAPI = { export const gnProcessResources = (action$) => action$.ofType(PROCESS_RESOURCES) - .switchMap((action) => { + // all the processes must be listened for this reason we should use flatMap instead of switchMap + .flatMap((action) => { return Observable.defer(() => axios.all( action.resources.map(resource => processAPI[action.processType](resource) diff --git a/geonode_mapstore_client/client/js/utils/LocalStorageUtils.js b/geonode_mapstore_client/client/js/utils/LocalStorageUtils.js index 99070cb955..2e2f6e26bc 100644 --- a/geonode_mapstore_client/client/js/utils/LocalStorageUtils.js +++ b/geonode_mapstore_client/client/js/utils/LocalStorageUtils.js @@ -13,7 +13,7 @@ const LOCAL_STORAGE_PROCESSES_KEY = 'gn.reducers.resourceservice.processes'; export function getLocalStorageProcesses() { try { const processes = JSON.parse(localStorage.getItem(LOCAL_STORAGE_PROCESSES_KEY)) || []; - return processes.filter(({ completed, output }) => !(completed || output?.status === ProcessStatus.FINISHED || output?.status === ProcessStatus.FAILED)); + return processes.filter(({ completed, output }) => !(completed || !output || output?.status === ProcessStatus.FINISHED || output?.status === ProcessStatus.FAILED)); } catch (e) { return []; }