Open infinityredux opened 3 years ago
@infinityredux Have you found a solution for this? If not, then can I pick this issue?
@infinityredux Have you found a solution for this? If not, then can I pick this issue?
Sorry, thought I would have had time to fix by now, but other things wound up taking priority. Feel free to pick up the issue.
Current behaviour
Found via code inspection in editor, because the
isBelowMax
variable is never actually used. Looking at the code currently it's checkingisBelowZero
a second time (which is redundant because ifisBelowZero
is true, the second if will never be reached.)Expected behavior
The value of
isBelowMax
should be used, presumably instead for the secondisBelowZero
,Steps to reproduce the issue
Current relevant code:
Can you handle fixing this bug by yourself?
Environment details
N/A
Additional information
Looking closer at this, I'm also not certain the actual
maxValue
validation is correct either:Based on the above, the Vuelidate
maxValue
function should returntrue
(valid) as long asvalue
is less than the given max value. However, the overallmaxValue
validation cannot evaluate to true unlessvalue
is less thanthis.maxQuantity
and the quantity is also unlimited (i.e.this.unlimitQuantity
is true.)So, unless I've misunderstood the purpose of
unlimitQuantity
(specifying that this product actually has an unlimited quantity) if this is true, themaxValue
validation should always be valid (there cannot be a value above unlimited / infinite.) In other words, I believe this should be a logical or instead of and?Finally, the name
isBelowMax
bothers me... it will only be true if themaxValue
validation fails (i.e. the value is above max.) So it should probably beisAboveMax
instead?