Cache la newsletter sur la prod

pull/456/head
Johan Girod 2019-02-18 16:54:31 +01:00
parent 1a7f87e4eb
commit 7d28f3f958
1 changed files with 4 additions and 2 deletions

View File

@ -32,11 +32,13 @@ const feedbackBlacklist = [
const LOCAL_STORAGE_KEY = 'app::newsletter::registered'
const userAlreadyRegistered: boolean =
JSON.parse(safeLocalStorage.getItem(LOCAL_STORAGE_KEY)) || false
JSON.parse(safeLocalStorage.getItem(LOCAL_STORAGE_KEY)) || false
const Footer = ({ colours: { colour }, tracker, t, sitePaths }) => {
const [showNewsletterForm, toggleNewsletterForm] = useState(
!userAlreadyRegistered
!userAlreadyRegistered && !['mycompanyinfrance.fr', 'mon-entreprise.fr'].includes(
window.location.hostname
)
)
const onSubmit = () => {
safeLocalStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(true))