This commit is contained in:
andrewwallacespeckle 2024-04-09 12:39:47 +01:00
Родитель 14b228e649
Коммит 2877db5e69
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -21,5 +21,11 @@ export const useSynchronizedCookie = <CookieValue = string>(
// something's off with nuxt's types here, have to use any
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
return useCookie<CookieValue>(name, finalOpts as any)
const cookie = useCookie<CookieValue>(name, finalOpts as any)
if (finalOpts.default) {
// there's a bug where default doesn't trigger a write for some reason
cookie.value = unref(finalOpts.default())
}
return cookie
})