Skip to content

Commit

Permalink
Fix #1855 The preview for maps shouldn't show the viewer plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored and giohappy committed Sep 20, 2024
1 parent 3770285 commit 31b0701
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geonode_mapstore_client/client/js/epics/gnresource.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ const resourceTypes = {
.then((resource) => {
const mapViewers = get(resource, 'linked_resources.linked_to', [])
.find(({ resource_type: type } = {}) => type === ResourceTypes.VIEWER);
return mapViewers?.pk
// if we are using a query parameter for configuration
// we should not use the associated viewer
const { query } = url.parse(window.location.href, true);
return !query.config && mapViewers?.pk
? axios.all([{...resource}, getGeoAppByPk(mapViewers?.pk, {api_preset: 'catalog_list', include: ['data', 'linked_resources']})])
: Promise.resolve([{...resource}]);
})
Expand Down

0 comments on commit 31b0701

Please sign in to comment.