fix(nuxt): only skip refetching errors when hydrating (#23889)

This commit is contained in:
Daniel Roe 2023-10-23 23:04:45 +09:00 committed by GitHub
parent ec708d9c81
commit ba4361a0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,7 +261,7 @@ export function useAsyncData<
}
}
if (asyncData.error.value || (fetchOnServer && nuxt.isHydrating && hasCachedData())) {
if (fetchOnServer && nuxt.isHydrating && (asyncData.error.value || hasCachedData())) {
// 1. Hydration (server: true): no fetch
asyncData.pending.value = false
asyncData.status.value = asyncData.error.value ? 'error' : 'success'