Skip to content

Commit

Permalink
⚗️ Test consent #2575
Browse files Browse the repository at this point in the history
  • Loading branch information
padms committed Oct 16, 2024
1 parent 8075a2a commit 172adfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/lib/hooks/useConsentState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ function useConsentState(consentType: CookieType[], callback: () => void, cleanu
const isLocalHost = host.includes('localhost')
const enableConsentLogic = !isLocalHost && (Flags.IS_DEV || !host.includes('radix.equinor.com'))
if (enableConsentLogic && consent) {
console.log('Consented ' + consentType)
callback()
return () => {
console.log('Not Consented ' + consentType)
if (cleanup) cleanup()
}
}
}, [router.asPath, consent, callback, cleanup])
}, [router.asPath, consent, callback, cleanup, consentType])
}
export default useConsentState

0 comments on commit 172adfa

Please sign in to comment.