[FIX] Google Analytics error

When Home component used in Login component, logEvent not passed.
Now Home component only logs events if logEvent is defined (i.e. it's not called from the Login component)
This commit is contained in:
2021-09-12 11:36:58 +01:00
parent 614c222bcc
commit a472c49efb

View File

@@ -19,7 +19,7 @@ export default function Home(props) {
document.title = "Parandum"; document.title = "Parandum";
useEffect(() => { useEffect(() => {
props.logEvent("page_view"); if (props.logEvent) props.logEvent("page_view");
}); });
return ( return (