Skip to content

Commit

Permalink
Do not save/display HD viewpoint for offline content
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Feb 7, 2024
1 parent 0f482a2 commit 57795cb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/pages/details/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ export const DetailsUIWithoutContext: React.FC<Props> = ({ slug, parentId, langu
</section>
);
}
if (section.name === 'medias' && details.viewPoints.length > 0) {
if (
hasNavigator &&
section.name === 'medias' &&
details.viewPoints.length > 0
) {
return (
<section
key={section.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const DetailsCard: React.FC<DetailsCardProps> = ({
{Boolean(description) && (
<>
<OptionalLink redirectionUrl={redirectionUrl}>{descriptionStyled}</OptionalLink>
{Number(viewPoints?.length) > 0 && truncateState !== 'TRUNCATE' && (
{hasNavigator && Number(viewPoints?.length) > 0 && truncateState !== 'TRUNCATE' && (
<div className="clear-both desktop:clear-none desktop:min-w-[420px] overflow-hidden py-6">
<DetailsMedias
viewPoints={viewPoints ?? []}
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/pages/site/OutdoorSiteUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ const OutdoorSiteUIWithoutContext: React.FC<Props> = ({ outdoorSiteUrl, language
</section>
);
}
if (section.name === 'medias' && outdoorSiteContent.viewPoints.length > 0) {
if (
hasNavigator &&
section.name === 'medias' &&
outdoorSiteContent.viewPoints.length > 0
) {
return (
<section
key={section.name}
Expand Down

0 comments on commit 57795cb

Please sign in to comment.