Skip to content

Commit

Permalink
Merge pull request #9 from studio-otto/brett/ariella-edits
Browse files Browse the repository at this point in the history
Brett/ariella edits
  • Loading branch information
mrbrett authored Nov 19, 2020
2 parents 75065f4 + a517967 commit 6201ad4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 22 deletions.
15 changes: 6 additions & 9 deletions dist/session-store.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const actions = {
}, checkoutId = null) {
commit("setCartIsBusy", true);
const id = checkoutId ? checkoutId : localStorage.getItem('currentCheckout');
const checkout = id && id !== "undefined" ? await getters.client.checkout.fetch(id) : await dispatch('createCheckout');
const checkoutCheck = id && id !== "undefined" ? await getters.client.checkout.fetch(id) : await dispatch('createCheckout'); // Sometimes we have an old checkout id but it has staled, if that is the case create a new one

const checkout = checkoutCheck == null ? await dispatch('createCheckout') : checkoutCheck;
commit('setCheckout', checkout);
commit("setCartIsBusy", false);
},
Expand Down Expand Up @@ -114,16 +116,11 @@ const actions = {
},

// UpdateLineItem: modify the quantity of (one line item) line item in checkout
// line item = {id: , quantity}
async updateLineItem({
dispatch
}, {
lineItemId,
quantity
}) {
dispatch('updateLineItems', [{
id: lineItemId,
quantity
}]);
}, lineItem) {
dispatch('updateLineItems', [lineItem]);
},

// removeLineItem: Remove a lineitem via id
Expand Down
Loading

0 comments on commit 6201ad4

Please sign in to comment.