Skip to content

Commit

Permalink
feat(cookie): split by |
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Feb 24, 2023
1 parent a43583f commit ff25117
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/runtime/components/CookieControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const isSaved = computed(
() =>
getCookieIds(cookiesEnabled.value || [])
.sort()
.join(',') !== getCookieIds(localCookiesEnabled.value).sort().join(',')
.join('|') !== getCookieIds(localCookiesEnabled.value).sort().join('|')
)
const localeStrings = computed(() => moduleOptions.localeTexts[props.locale])
Expand Down Expand Up @@ -340,7 +340,7 @@ watch(
if (isConsentGiven.value) {
setCookie(
moduleOptions.cookieNameCookiesEnabledIds,
getCookieIds(current || []).join(','),
getCookieIds(current || []).join('|'),
{
expires,
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineNuxtPlugin((_nuxtApp) => {
)
const cookieCookiesEnabledIds = Cookies.get(
moduleOptions.cookieNameCookiesEnabledIds
)?.split(',')
)?.split('|')

const isConsentGiven = ref<boolean | undefined>(
cookieIsConsentGiven === undefined
Expand Down

0 comments on commit ff25117

Please sign in to comment.