Skip to content

Commit d9334a5

Browse files
authored
fix(theme): fix flashing category page (#387)
Co-authored-by: Bartosz Herba <[email protected]>
1 parent e700ed1 commit d9334a5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/theme/pages/Category.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
</LazyHydrate>
9797
</div>
9898
<SfLoader
99-
:class="{ loading }"
100-
:loading="loading"
99+
:class="{ loading: isProductsLoading }"
100+
:loading="isProductsLoading"
101101
>
102102
<div
103-
v-if="!loading"
103+
v-if="!isProductsLoading"
104104
class="products"
105105
>
106106
<transition-group
@@ -196,7 +196,7 @@
196196

197197
<LazyHydrate on-interaction>
198198
<SfPagination
199-
v-if="!loading"
199+
v-if="!isProductsLoading"
200200
v-show="pagination.totalPages > 1"
201201
class="products__pagination desktop-only"
202202
:current="pagination.currentPage"
@@ -540,7 +540,9 @@ export default defineComponent({
540540
});
541541
};
542542
543+
const isProductsLoading = ref(false);
543544
onSSR(async () => {
545+
isProductsLoading.value = true;
544546
await resolveUrl();
545547
546548
await categoriesSearch({
@@ -566,6 +568,7 @@ export default defineComponent({
566568
}
567569
568570
await searchCategoryProduct();
571+
isProductsLoading.value = false;
569572
}
570573
});
571574
@@ -586,7 +589,7 @@ export default defineComponent({
586589
isFilterSelected,
587590
isInCart,
588591
isInWishlist,
589-
loading,
592+
isProductsLoading,
590593
pagination,
591594
productGetters,
592595
products,

0 commit comments

Comments
 (0)