From 57795cbbac127adfd577fbcff3183745553c8a77 Mon Sep 17 00:00:00 2001 From: Florian Sommariva Date: Mon, 29 Jan 2024 17:33:00 +0100 Subject: [PATCH] Do not save/display HD viewpoint for offline content --- frontend/cache.js | 1 + frontend/src/components/pages/details/Details.tsx | 6 +++++- .../pages/details/components/DetailsCard/DetailsCard.tsx | 2 +- frontend/src/components/pages/site/OutdoorSiteUI.tsx | 6 +++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/cache.js b/frontend/cache.js index 67a4685b5..aeeee869a 100644 --- a/frontend/cache.js +++ b/frontend/cache.js @@ -37,6 +37,7 @@ module.exports = [ && !url.host.includes('stamen-tiles') && !url.host.includes('wxs.ign.fr') && !url.host.includes('data.geopf.fr') + && !url.pathname.startsWith('/api/hdviewpoint/drf/hdviewpoints/') && request.destination === 'image' }, handler: 'NetworkFirst', diff --git a/frontend/src/components/pages/details/Details.tsx b/frontend/src/components/pages/details/Details.tsx index 6079dbd0d..9aa47f26b 100644 --- a/frontend/src/components/pages/details/Details.tsx +++ b/frontend/src/components/pages/details/Details.tsx @@ -208,7 +208,11 @@ export const DetailsUIWithoutContext: React.FC = ({ slug, parentId, langu ); } - if (section.name === 'medias' && details.viewPoints.length > 0) { + if ( + hasNavigator && + section.name === 'medias' && + details.viewPoints.length > 0 + ) { return (
= ({ {Boolean(description) && ( <> {descriptionStyled} - {Number(viewPoints?.length) > 0 && truncateState !== 'TRUNCATE' && ( + {hasNavigator && Number(viewPoints?.length) > 0 && truncateState !== 'TRUNCATE' && (
= ({ outdoorSiteUrl, language
); } - if (section.name === 'medias' && outdoorSiteContent.viewPoints.length > 0) { + if ( + hasNavigator && + section.name === 'medias' && + outdoorSiteContent.viewPoints.length > 0 + ) { return (