fix(nuxt): correctly update object cookies in useCookie (#22474)

This commit is contained in:
Peter Graugaard 2023-08-03 18:33:34 +02:00 committed by GitHub
parent 692ce5f010
commit a4e58bc352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,8 +53,8 @@ export function useCookie<T = string | null | undefined> (name: string, _opts?:
} }
if (opts.watch) { if (opts.watch) {
watch(cookie, (newVal, oldVal) => { watch(cookie, () => {
if (watchPaused || isEqual(newVal, oldVal)) { return } if (watchPaused) { return }
callback() callback()
}, },
{ deep: opts.watch !== 'shallow' }) { deep: opts.watch !== 'shallow' })