mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 01:53:55 +00:00
fix(nuxt): early return from refreshCookie
on server
This commit is contained in:
parent
cca81bcae4
commit
22ada37b4f
@ -132,7 +132,7 @@ export function useCookie<T = string | null | undefined> (name: string, _opts?:
|
|||||||
}
|
}
|
||||||
/** @since 3.10.0 */
|
/** @since 3.10.0 */
|
||||||
export function refreshCookie (name: string) {
|
export function refreshCookie (name: string) {
|
||||||
if (store || typeof BroadcastChannel === 'undefined') { return }
|
if (import.meta.server || store || typeof BroadcastChannel === 'undefined') { return }
|
||||||
|
|
||||||
new BroadcastChannel(`nuxt:cookies:${name}`)?.postMessage({ refresh: true })
|
new BroadcastChannel(`nuxt:cookies:${name}`)?.postMessage({ refresh: true })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user