@@ -16,12 +16,12 @@ const {isNil, find} = require('lodash');
1616const {
1717 SAVE_DETAILS , SAVE_RESOURCE_DETAILS , MAPS_GET_MAP_RESOURCES_BY_CATEGORY ,
1818 DELETE_MAP , OPEN_DETAILS_PANEL , MAPS_LOAD_MAP ,
19- CLOSE_DETAILS_PANEL , NO_DETAILS_AVAILABLE , SAVE_MAP_RESOURCE ,
19+ CLOSE_DETAILS_PANEL , NO_DETAILS_AVAILABLE , SAVE_MAP_RESOURCE , MAP_DELETED ,
2020 setDetailsChanged, updateDetails, mapsLoading, mapsLoaded,
2121 mapDeleting, toggleDetailsEditability, mapDeleted, loadError,
2222 doNothing, detailsLoaded, detailsSaving, onDisplayMetadataEdit,
2323 RESET_UPDATING , resetUpdating, toggleDetailsSheet, getMapResourcesByCategory,
24- mapUpdating, savingMap, mapCreated, mapError
24+ mapUpdating, savingMap, mapCreated, mapError, loadMaps
2525} = require ( '../actions/maps' ) ;
2626const {
2727 resetCurrentMap, EDIT_MAP
@@ -30,7 +30,9 @@ const {closeFeatureGrid} = require('../actions/featuregrid');
3030const { toggleControl} = require ( '../actions/controls' ) ;
3131const {
3232 mapPermissionsFromIdSelector, mapThumbnailsUriFromIdSelector,
33- mapDetailsUriFromIdSelector
33+ mapDetailsUriFromIdSelector,
34+ searchTextSelector,
35+ searchParamsSelector
3436} = require ( '../selectors/maps' ) ;
3537
3638const {
@@ -187,6 +189,14 @@ const loadMapsEpic = (action$) =>
187189
188190 } ) ;
189191
192+ const reloadMapsEpic = ( action$ , { getState = ( ) => { } } ) =>
193+ action$ . ofType ( MAP_DELETED )
194+ . delay ( 1000 )
195+ . switchMap ( ( ) => Rx . Observable . of ( loadMaps ( false ,
196+ searchTextSelector ( getState ( ) ) ,
197+ searchParamsSelector ( getState ( ) )
198+ ) ) ) ;
199+
190200const getMapsResourcesByCategoryEpic = ( action$ ) =>
191201 action$ . ofType ( MAPS_GET_MAP_RESOURCES_BY_CATEGORY )
192202 . switchMap ( ( action ) => {
@@ -357,5 +367,6 @@ module.exports = {
357367 setDetailsChangedEpic,
358368 fetchDetailsFromResourceEpic,
359369 saveResourceDetailsEpic,
360- mapSaveMapResourceEpic
370+ mapSaveMapResourceEpic,
371+ reloadMapsEpic
361372} ;
0 commit comments