From 89b3f262d624b2b191bea1261468fa72e52aca5f Mon Sep 17 00:00:00 2001 From: Christopher Stevers <72156679+Christopher-Stevers@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:50:35 +0000 Subject: [PATCH] fixed issue where knock wasn't working on firefox, and uses dark theme --- components/Layout/Navigation.js | 7 +++++-- components/Notifications/NotificationBell.js | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/Layout/Navigation.js b/components/Layout/Navigation.js index 9e69a16db..8a3f12e53 100755 --- a/components/Layout/Navigation.js +++ b/components/Layout/Navigation.js @@ -26,8 +26,11 @@ const Navigation = () => { useEffect(() => { const getNotificationCookie = async () => { - const signedKnockTokenCookie = await window?.cookieStore?.get('signed_knock_token'); - setNotificationToken(signedKnockTokenCookie?.value); + // regex for signed_knock_token cookie + const signedKnockTokenCookie = document.cookie.match(/(signed_knock_token=)(.*?)+/)[0].slice(19); + + console.log(signedKnockTokenCookie); + setNotificationToken(signedKnockTokenCookie); }; getNotificationCookie(); diff --git a/components/Notifications/NotificationBell.js b/components/Notifications/NotificationBell.js index 219956836..da7fb7a0f 100644 --- a/components/Notifications/NotificationBell.js +++ b/components/Notifications/NotificationBell.js @@ -15,6 +15,7 @@ const NotificationBell = ({ userId, notificationToken }) => { return ( { setIsVisible(!isVisible)} /> notificationClicked(item)} onClose={() => setIsVisible(false)}