Skip to content

Commit

Permalink
Fix nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
vietredweb committed Sep 13, 2024
1 parent 37dc50f commit 8eb1c0c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Components/OptInConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ declare global {
}
}

const endpoint = window['aesirx1stparty']
? window['aesirx1stparty']
: process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL
let endpoint = process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL
? process?.env?.NEXT_PUBLIC_ENDPOINT_ANALYTICS_URL
: process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
? process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
: '';
? process?.env?.REACT_APP_ENDPOINT_ANALYTICS_URL
: '';
if (typeof window !== 'undefined') {
if (window['aesirx1stparty']) {
endpoint = window['aesirx1stparty'];
}
}
const OptInConsent = ({
optInConsentData = window?.optInConsentData ? JSON.parse(window?.optInConsentData) : [],
}: Props) => {
Expand Down Expand Up @@ -148,13 +151,13 @@ const OptInConsent = ({
type="checkbox"
label={
item === 'aesirx-analytics-optin-default'
? (window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ?? t('txt_revoke_opt_in')
: (window as any)?.aesirx_analytics_translate
? ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ?? t('txt_revoke_opt_in'))
: ((window as any)?.aesirx_analytics_translate
?.txt_revoke_opt_in ??
t('txt_revoke_opt_in') +
' ' +
item?.replace('aesirx-analytics-optin-', '')
item?.replace('aesirx-analytics-optin-', ''))
}
value={item}
onChange={({ target: { value } }) => {
Expand Down

0 comments on commit 8eb1c0c

Please sign in to comment.