Skip to content

Commit

Permalink
perf(theme): lazy load loginModal
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszherba authored and Frodigo committed Feb 18, 2022
1 parent 4c2dbcc commit ac62c4a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/theme/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<div>
<CartSidebar v-if="isCartSidebarOpen" />
<WishlistSidebar v-if="isWishlistSidebarOpen" />
<LazyHydrate when-visible>
<LoginModal />
</LazyHydrate>
<LoginModal v-if="isLoginModalOpen" />
<LazyHydrate when-visible>
<Notification />
</LazyHydrate>
Expand Down Expand Up @@ -52,7 +50,7 @@ export default defineComponent({
const route = useRoute();
const { load: loadUser } = useUser();
const { loadConfiguration } = useMagentoConfiguration();
const { isCartSidebarOpen, isWishlistSidebarOpen } = useUiState();
const { isCartSidebarOpen, isWishlistSidebarOpen, isLoginModalOpen } = useUiState();
useAsync(() => {
loadConfiguration();
Expand All @@ -65,6 +63,7 @@ export default defineComponent({
return {
isCartSidebarOpen,
isWishlistSidebarOpen,
isLoginModalOpen,
route,
};
},
Expand Down

0 comments on commit ac62c4a

Please sign in to comment.