From 2e43b6789dd84390f7f912e36fa90acc4a9f2151 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Wed, 15 Jan 2020 15:50:43 +0100 Subject: [PATCH] =?UTF-8?q?Ne=20pas=20afficher=20la=20banni=C3=A8re=20nouv?= =?UTF-8?q?eaut=C3=A9=20lors=20de=20la=20premi=C3=A8re=20visite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/sites/mon-entreprise.fr/layout/NewsBanner.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx b/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx index 2c60012dd..30216bbb9 100644 --- a/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx +++ b/source/sites/mon-entreprise.fr/layout/NewsBanner.tsx @@ -5,7 +5,6 @@ import emoji from 'react-easy-emoji' import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' import { lastRelease } from '../../../data/last-release.json' -import { inIframe } from '../../../utils' const localStorageKey = 'last-viewed-release' @@ -16,15 +15,15 @@ export default function NewsBanner() { const sitePaths = useContext(SitePathsContext) const { i18n } = useTranslation() - const showBanner = - lastViewedRelease !== lastRelease && i18n.language === 'fr' && !inIframe() - // We only want to show the banner to returning visitors, so we initiate the // local storage value with the last release. - if (showBanner && lastViewedRelease === undefined) { + if (lastViewedRelease === undefined) { hideNewsBanner() + return null } + const showBanner = lastViewedRelease !== lastRelease && i18n.language === 'fr' + return showBanner ? (