Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
jlengstorf committed Jan 10, 2019
2 parents 91e7ae7 + f2678a4 commit 07051aa
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/Layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,16 @@ export default class Layout extends React.Component {
const fetchCheckout = id => this.state.store.client.checkout.fetch(id);

if (existingCheckoutID) {
const checkout = await fetchCheckout(existingCheckoutID);
try {
const checkout = await fetchCheckout(existingCheckoutID);

// Make sure this cart hasn’t already been purchased.
if (!checkout.completedAt) {
setCheckoutInState(checkout);
return;
// Make sure this cart hasn’t already been purchased.
if (!checkout.completedAt) {
setCheckoutInState(checkout);
return;
}
} catch (e) {
localStorage.setItem('shopify_checkout_id', null);
}
}

Expand Down

0 comments on commit 07051aa

Please sign in to comment.