Skip to content

Commit

Permalink
Fix geosolutions-it#10153 improved details reset when switching page (g…
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 authored Apr 5, 2024
1 parent 3546f64 commit 03ec9c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion web/client/epics/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ export const storeDetailsInfoEpic = (action$, store) =>
.switchMap(({mapId, info: {attributes}}) => {
const isTutorialRunning = store.getState()?.tutorial?.run;
let details = attributes?.details;
const detailsSettings = attributes?.detailsSettings;
let detailsSettings;
try {
detailsSettings = JSON.parse(attributes?.detailsSettings);
} catch (e) {
detailsSettings = {};
}

if (!details || details.value === EMPTY_RESOURCE_VALUE) {
return Observable.empty();
}
Expand Down
3 changes: 2 additions & 1 deletion web/client/epics/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import Rx from 'rxjs';
import { LOCATION_CHANGE } from 'connected-react-router';

import {
OPEN_DETAILS_PANEL,
Expand Down Expand Up @@ -54,7 +55,7 @@ export const fetchDataForDetailsPanel = (action$, store) =>
});

export const closeDetailsPanelEpic = (action$) =>
action$.ofType(CLOSE_DETAILS_PANEL)
action$.ofType(CLOSE_DETAILS_PANEL, LOCATION_CHANGE)
.switchMap(() => Rx.Observable.from( [
setControlProperty("details", "enabled", false)
])
Expand Down

0 comments on commit 03ec9c3

Please sign in to comment.