From d3d1bb24d727f3a8de9f59217fc8ee897a697564 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Wed, 11 Jan 2023 18:13:52 +0100 Subject: [PATCH] fix: goatcounter onload error --- client/App.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/App.tsx b/client/App.tsx index 91dccc5..26bc63f 100644 --- a/client/App.tsx +++ b/client/App.tsx @@ -34,9 +34,12 @@ export const App = ({ url }: { url?: string }) => { const handleRouteChange = () => { // @ts-ignore - window.goatcounter.count({ - path: location.pathname + location.search + location.hash, - }) + if (window.goatcounter) { + // @ts-ignore + window.goatcounter.count({ + path: location.pathname + location.search + location.hash, + }) + } } return (