mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 01:53:55 +00:00
fix(nuxt): flag async data promise as cancelled only if defined (#27690)
This commit is contained in:
parent
f365a2783c
commit
523a1fad8f
@ -543,7 +543,10 @@ function clearNuxtDataByKey (nuxtApp: NuxtApp, key: string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key in nuxtApp._asyncDataPromises) {
|
if (key in nuxtApp._asyncDataPromises) {
|
||||||
(nuxtApp._asyncDataPromises[key] as any).cancelled = true
|
if (nuxtApp._asyncDataPromises[key]) {
|
||||||
|
(nuxtApp._asyncDataPromises[key] as any).cancelled = true
|
||||||
|
}
|
||||||
|
|
||||||
nuxtApp._asyncDataPromises[key] = undefined
|
nuxtApp._asyncDataPromises[key] = undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user