From 665c1d5ad1cdfa978c91d70bd742c2c239615349 Mon Sep 17 00:00:00 2001 From: Lauren Davidson <32903719+1aurend@users.noreply.github.com> Date: Tue, 23 Jan 2024 12:48:56 -0800 Subject: [PATCH] [B] Add guard for undefined consent cookie --- client/src/hoc/analytics/hooks/useManifoldAnalytics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/hoc/analytics/hooks/useManifoldAnalytics.js b/client/src/hoc/analytics/hooks/useManifoldAnalytics.js index 349488beab..d25cee8b2a 100644 --- a/client/src/hoc/analytics/hooks/useManifoldAnalytics.js +++ b/client/src/hoc/analytics/hooks/useManifoldAnalytics.js @@ -39,7 +39,7 @@ function getTokens() { export default function useManifoldAnalytics(location, settings, dispatch) { const { currentUser } = useFromStore("authentication") ?? {}; - const anonConsent = JSON.parse(cookie.read("anonAnalyticsConsent") ?? ""); + const anonConsent = JSON.parse(cookie.read("anonAnalyticsConsent") ?? "{}"); const consentManifoldAnalytics = currentUser?.attributes?.consentManifoldAnalytics ||