Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty list of currencies while trying to change currency #1183

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions packages/theme/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
</template>
<template #aside>
<div class="sf-header__switchers">
<CurrencySelector class="smartphone-only" />
<StoreSwitcher class="smartphone-only" />
<CurrencySelector
v-if="hasCurrencyToSelect"
class="smartphone-only"
/>
<StoreSwitcher
v-if="hasStoresToSelect"
class="smartphone-only"
/>
</div>
</template>
<template #header-icons="{ activeIcon }">
Expand Down Expand Up @@ -127,22 +133,21 @@ import { useWishlist } from '~/modules/wishlist/composables/useWishlist';
import { useUser } from '~/modules/customer/composables/useUser';
import { useWishlistStore } from '~/modules/wishlist/store/wishlistStore';
import type { CategoryTree, ProductInterface } from '~/modules/GraphQL/types';
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 { useTopBar } from './TopBar/useTopBar';

export default defineComponent({
components: {
HeaderNavigation,
SfHeader,
SfOverlay,
CurrencySelector,
HeaderLogo,
StoreSwitcher,
SvgImage,
SfButton,
SfBadge,
CurrencySelector: () => import('~/components/CurrencySelector.vue'),
StoreSwitcher: () => import('~/components/StoreSwitcher.vue'),
SearchBar: () => import('~/components/Header/SearchBar/SearchBar.vue'),
SearchResults: () => import(
/* webpackPrefetch: true */ '~/components/Header/SearchBar/SearchResults.vue'
Expand All @@ -158,6 +163,8 @@ export default defineComponent({
const { loadItemsCount: loadWishlistItemsCount } = useWishlist();
const { categories: categoryList, load: categoriesListLoad } = useCategory();

const { hasCurrencyToSelect, hasStoresToSelect } = useTopBar();

const isSearchOpen = ref(false);
const productSearchResults = ref<ProductInterface[] | null>(null);

Expand Down Expand Up @@ -205,6 +212,8 @@ export default defineComponent({
toggleWishlistSidebar,
wishlistHasProducts,
wishlistItemsQty,
hasCurrencyToSelect,
hasStoresToSelect,
};
},
});
Expand Down