Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions packages/theme/components/WishlistSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ import {
SfCollectedProduct,
SfLink,
} from '@storefront-ui/vue';
import { computed, defineComponent } from '@nuxtjs/composition-api';
import { computed, defineComponent, onMounted } from '@nuxtjs/composition-api';
import {
useWishlist,
useUser,
Expand All @@ -178,7 +178,7 @@ export default defineComponent({
},
setup() {
const { isWishlistSidebarOpen, toggleWishlistSidebar } = useUiState();
const { wishlist, removeItem } = useWishlist('GlobalWishlist');
const { wishlist, removeItem, load: loadWishlist } = useWishlist('GlobalWishlist');
const { isAuthenticated } = useUser();
const products = computed(() => wishlistGetters.getProducts(wishlist.value));
const totals = computed(() => wishlistGetters.getTotals(wishlist.value));
Expand All @@ -189,6 +189,10 @@ export default defineComponent({

const { getMagentoImage, imageSizes } = useImage();

onMounted(() => {
loadWishlist();
});

return {
getAttributes,
getBundles,
Expand Down
27 changes: 9 additions & 18 deletions packages/theme/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
<template>
<div>
<LazyHydrate when-visible>
<TopBar class="desktop-only" />
</LazyHydrate>

<AppHeader />

<div id="layout">
<nuxt :key="route.fullPath" />
</div>

<LazyHydrate when-visible>
<BottomNavigation />
</LazyHydrate>
<LazyHydrate when-idle>
<CartSidebar />
</LazyHydrate>
<LazyHydrate when-idle>
<LazyHydrate when-visible>
<WishlistSidebar />
</LazyHydrate>
<LazyHydrate when-visible>
<LoginModal />
</LazyHydrate>
<LazyHydrate when-idle>
<Notification />
</LazyHydrate>
<LazyHydrate when-visible>
<AppFooter />
<Notification />
</LazyHydrate>
<TopBar class="desktop-only" />
<AppHeader />
<div id="layout">
<nuxt :key="route.fullPath" />
</div>
<BottomNavigation />
<AppFooter />
</div>
</template>

Expand Down