Skip to content

Commit

Permalink
fix undefined if not items on cart
Browse files Browse the repository at this point in the history
  • Loading branch information
octavioamu committed Apr 8, 2021
1 parent cb46db6 commit 9c280af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/assets/v2/js/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,12 @@ Vue.component('grants-cart', {
updatedGrant[grantIndex]['grant_donation_amount'] = grant.grant_donation_amount ? grant.grant_donation_amount : '0.001';
});

CartData.setCart(updatedGrant);
this.grantData = updatedGrant;
if (updatedGrant) {
CartData.setCart(updatedGrant);
this.grantData = updatedGrant;
} else {
this.grantData = [];
}

// Initialize array of empty comments
this.comments = this.grantData.map(grant => undefined);
Expand Down

0 comments on commit 9c280af

Please sign in to comment.