Skip to content

Commit

Permalink
fix(nuxt3-app): loading addresses (SWF-208)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanilowicz committed Nov 29, 2022
1 parent d7333d1 commit 6693d2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-dogs-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vue-demo-store": patch
---

Fix loading addresses on the checkout only when the user is logged in
19 changes: 11 additions & 8 deletions templates/vue-demo-store/pages/checkout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,20 @@ const placeOrder = async () => {
onMounted(async () => {
refreshSessionContext();
isLoading["shippingMethods"] = true;
await getShippingMethods();
isLoading["shippingMethods"] = false;
isLoading["shippingAddress"] = true;
isLoading["shippingMethods"] = true;
isLoading["paymentMethods"] = true;
await getPaymentMethods();
isLoading["paymentMethods"] = false;
isLoading["shippingAddress"] = true;
await loadCustomerAddresses();
isLoading["shippingAddress"] = false;
Promise.any([
isLoggedIn.value ? loadCustomerAddresses() : null,
getShippingMethods(),
getPaymentMethods(),
]).finally(() => {
isLoading["shippingAddress"] = false;
isLoading["shippingMethods"] = false;
isLoading["paymentMethods"] = false;
});
});
const registerErrors = ref<ShopwareError[]>([]);
Expand Down

0 comments on commit 6693d2f

Please sign in to comment.