Skip to content

Commit

Permalink
fix: #75 ugly fix to reset localStorage cart.items
Browse files Browse the repository at this point in the history
  • Loading branch information
evaletolab committed Oct 27, 2020
1 parent 5984eab commit e1d0c0a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cart.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ export class CartService {
// remove all items for this HUB
this.cache.items = [];
this.cache.discount = {};
//
// FIXME dont use localstorage here
localStorage.setItem('kng2-cart', JSON.stringify(this.cache));
this.save({ action: CartAction.CART_CLEARED });
return new Observable((obs) => {
this.cart$.subscribe(state => {
Expand Down

0 comments on commit e1d0c0a

Please sign in to comment.