From 4ab48c4b85539043fb5adfadb49bf37308d300c8 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 6 Jan 2021 16:15:30 +1100 Subject: [PATCH] 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. --- app/assets/javascripts/darkswarm/services/variants.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/variants.js.coffee b/app/assets/javascripts/darkswarm/services/variants.js.coffee index f5ba1af757..bcca5be825 100644 --- a/app/assets/javascripts/darkswarm/services/variants.js.coffee +++ b/app/assets/javascripts/darkswarm/services/variants.js.coffee @@ -23,5 +23,5 @@ Darkswarm.factory 'Variants', -> lineItemFor: (variant) -> variant: variant - quantity: null - max_quantity: null + quantity: 0 + max_quantity: 0