[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:
mg committed 2021-09-12 11:36:58 +01:00
1 parent 614c222bcc
commit a472c49efb
1 file changed
+1 -1
+1 -1
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 (