Skip to content

Commit

Permalink
fix: opt in to import.meta.* properties
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored and tkjaergaard committed Apr 7, 2024
1 parent 62f5e7d commit 816beb7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runtime/composables/useCookieConsent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export function useCookieConsent(): NuxtCookieConsentUseCookieConsent {
}

export function cookieConsentRenew(): void {
if (process.client) {
if (import.meta.client) {
window?.CookieConsent?.renew?.()
}
}

export function cookieConsentShow(): void {
if (process.client) {
if (import.meta.client) {
window?.CookieConsent?.show?.()
}
}
2 changes: 1 addition & 1 deletion src/runtime/plugins/cookiebot.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default defineNuxtPlugin(() => {
})
}

if (process.client) {
if (import.meta.client) {
window.addEventListener('CookiebotOnAccept', () => {
if (!window?.Cookiebot?.consent) {
return
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/plugins/cookieinformation.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default defineNuxtPlugin(() => {
})
}

if (process.client) {
if (import.meta.client) {
window.addEventListener('CookieInformationConsentGiven', () => {
if (!window?.CookieInformation?.getConsentGivenFor) {
return
Expand Down

0 comments on commit 816beb7

Please sign in to comment.