Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: nullify shared state
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 7, 2022
1 parent 315190e commit 2af6412
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/nuxt/src/app/composables/asyncData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ export function clearNuxtData (keys?: string | string[]): void {
if (key in nuxtApp.payload._errors) {
nuxtApp.payload._errors[key] = undefined
}
if (key in nuxtApp._asyncData) {
nuxtApp._asyncData[key] = undefined
if (nuxtApp._asyncData[key]) {
nuxtApp._asyncData[key]!.data.value = undefined
nuxtApp._asyncData[key]!.error.value = undefined
nuxtApp._asyncData[key]!.pending.value = false
}
if (key in nuxtApp._asyncDataPromises) {
nuxtApp._asyncDataPromises[key] = undefined
Expand Down

0 comments on commit 2af6412

Please sign in to comment.