Merge pull request #6528 from mprieger/5546-cart-page-last-item-deletion

Fix users removing last item of confirmed order on /cart page
This commit is contained in:
Pau Pérez Fabregat
2021-03-04 17:27:51 +01:00
committed by GitHub
4 changed files with 27 additions and 9 deletions

View File

@@ -115,6 +115,9 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo
@line_items = []
localStorageService.clearAll() # One day this will have to be moar GRANULAR
has_one_line_item: =>
@line_items_finalised.length == 1
removeFinalisedLineItem: (id) =>
@line_items_finalised = @line_items_finalised.filter (item) ->
item.id != id