Initialise valid quantities when choosing OCs

Line items were initialised with undefined quantities which makes it
impossible to distinguish between the initial unset quantity and a user
entering an invalid quantity. When a user changed order cycles, all
quantities are reset and the UI displayed the quantity modifier buttons
instead of the Add button.

Initialising with the valid quantity 0 helps us to display the Add
button in that situation.
This commit is contained in:
Maikel Linke
2021-01-06 16:15:30 +11:00
parent bd731267ec
commit 4ab48c4b85

View File

@@ -23,5 +23,5 @@ Darkswarm.factory 'Variants', ->
lineItemFor: (variant) ->
variant: variant
quantity: null
max_quantity: null
quantity: 0
max_quantity: 0