Skip to content

Commit

Permalink
fix: flag async data promise as cancelled only if defined (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
wattanx authored Jun 19, 2024
1 parent a8b34b7 commit 347d62e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bridge/src/runtime/composables/asyncData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,10 @@ function clearNuxtDataByKey (nuxtApp: NuxtAppCompat, key: string): void {
}

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
}
}
Expand Down

0 comments on commit 347d62e

Please sign in to comment.