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
1 changed files with 2 additions and 2 deletions

View File

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