Skip to content

Commit ac62c4a

Browse files
bartoszherbaFrodigo
authored andcommitted
perf(theme): lazy load loginModal
1 parent 4c2dbcc commit ac62c4a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/theme/layouts/default.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
<div>
33
<CartSidebar v-if="isCartSidebarOpen" />
44
<WishlistSidebar v-if="isWishlistSidebarOpen" />
5-
<LazyHydrate when-visible>
6-
<LoginModal />
7-
</LazyHydrate>
5+
<LoginModal v-if="isLoginModalOpen" />
86
<LazyHydrate when-visible>
97
<Notification />
108
</LazyHydrate>
@@ -52,7 +50,7 @@ export default defineComponent({
5250
const route = useRoute();
5351
const { load: loadUser } = useUser();
5452
const { loadConfiguration } = useMagentoConfiguration();
55-
const { isCartSidebarOpen, isWishlistSidebarOpen } = useUiState();
53+
const { isCartSidebarOpen, isWishlistSidebarOpen, isLoginModalOpen } = useUiState();
5654
5755
useAsync(() => {
5856
loadConfiguration();
@@ -65,6 +63,7 @@ export default defineComponent({
6563
return {
6664
isCartSidebarOpen,
6765
isWishlistSidebarOpen,
66+
isLoginModalOpen,
6867
route,
6968
};
7069
},

0 commit comments

Comments
 (0)