diff --git a/packages/theme/components/AppHeader.vue b/packages/theme/components/AppHeader.vue index 797332f50..d3ed18f55 100644 --- a/packages/theme/components/AppHeader.vue +++ b/packages/theme/components/AppHeader.vue @@ -136,6 +136,7 @@ import CurrencySelector from '~/components/CurrencySelector.vue'; import HeaderLogo from '~/components/HeaderLogo.vue'; import SvgImage from '~/components/General/SvgImage.vue'; import StoreSwitcher from '~/components/StoreSwitcher.vue'; +import { useCustomerStore } from '~/stores/customer'; export default defineComponent({ components: { @@ -161,12 +162,12 @@ export default defineComponent({ const { isAuthenticated } = useUser(); const { loadTotalQty: loadCartTotalQty, cart } = useCart(); const { loadItemsCount: loadWishlistItemsCount } = useWishlist(); - const { categories: categoryList, load: categoriesListLoad } = useCategory(); + const customerStore = useCustomerStore(); const isSearchOpen = ref(false); const result = ref(null); - const wishlistItemsQty = ref(null); + const wishlistItemsQty = computed(() => customerStore.wishlist?.items_count ?? 0); const wishlistHasProducts = computed(() => wishlistItemsQty.value > 0); const accountIcon = computed(() => (isAuthenticated.value ? 'profile_fill' : 'profile')); @@ -187,16 +188,11 @@ export default defineComponent({ .filter((category) => category.include_in_menu); }); - onMounted(() => { + onMounted(async () => { if (app.$device.isDesktop) { - loadCartTotalQty(); + await loadCartTotalQty(); // eslint-disable-next-line promise/catch-or-return - loadWishlistItemsCount({}) - .then((response) => { - wishlistItemsQty.value = response; - - return response; - }); + await loadWishlistItemsCount({}); } }); diff --git a/packages/theme/components/CartSidebar.vue b/packages/theme/components/CartSidebar.vue index 81f899fbf..a97e8c38d 100644 --- a/packages/theme/components/CartSidebar.vue +++ b/packages/theme/components/CartSidebar.vue @@ -4,6 +4,7 @@ v-e2e="'sidebar-cart'" :visible="isCartSidebarOpen" :title="$t('My Cart')" + position="right" class="sf-sidebar--right" @close="toggleCartSidebar" > diff --git a/packages/theme/components/WishlistSidebar.vue b/packages/theme/components/WishlistSidebar.vue index bb684d1c1..899360520 100644 --- a/packages/theme/components/WishlistSidebar.vue +++ b/packages/theme/components/WishlistSidebar.vue @@ -3,6 +3,7 @@