File tree Expand file tree Collapse file tree
libs/storefront-data/src/products Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -396,8 +396,10 @@ export function createProductHooks<
396396 const cached = queryClient . getQueryData ( queryKey )
397397 const useGlobalFetcher =
398398 prefetchOptions ?. useGlobalFetcher && service . getProductsGlobal
399+ const skipIfCachedResolved =
400+ prefetchOptions ?. skipIfCached ?? skipIfCached
399401
400- if ( skipIfCached && cached ) {
402+ if ( skipIfCachedResolved && cached ) {
401403 return
402404 }
403405
@@ -432,8 +434,10 @@ export function createProductHooks<
432434 const cached = queryClient . getQueryData ( queryKey )
433435 const useGlobalFetcher =
434436 prefetchOptions ?. useGlobalFetcher && service . getProductsGlobal
437+ const skipIfCachedResolved =
438+ prefetchOptions ?. skipIfCached ?? skipIfCached
435439
436- if ( skipIfCached && cached ) {
440+ if ( skipIfCachedResolved && cached ) {
437441 return
438442 }
439443
@@ -533,8 +537,10 @@ export function createProductHooks<
533537 const detailParams = buildDetail ( resolvedInput )
534538 const queryKey = resolvedQueryKeys . detail ( detailParams )
535539 const cached = queryClient . getQueryData ( queryKey )
540+ const skipIfCachedResolved =
541+ prefetchOptions ?. skipIfCached ?? skipIfCached
536542
537- if ( skipIfCached && cached ) {
543+ if ( skipIfCachedResolved && cached ) {
538544 return
539545 }
540546
You can’t perform that action at this time.
0 commit comments