diff --git a/components/header.js b/components/header.js index fb49b551..1580dcfb 100644 --- a/components/header.js +++ b/components/header.js @@ -122,9 +122,18 @@ export default function Header ({ sub }) { if (!fired) { const strike = useLightning() useEffect(() => { - setTimeout(strike, randInRange(3000, 10000)) - setFired(true) - }, [router.asPath]) + let isMounted = true + if (!localStorage.getItem('striked')) { + setTimeout(() => { + if (isMounted) { + strike() + localStorage.setItem('striked', 'yep') + setFired(true) + } + }, randInRange(3000, 10000)) + } + return () => { isMounted = false } + }, []) } return path !== '/login' && !path.startsWith('/invites') &&