Skip to content

Commit

Permalink
fix: clean code refacto
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianRid committed Jun 29, 2021
1 parent a207f38 commit f77876e
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ export default function ProductCustomSelectList(props) {

function onQuantityAdjust(item, _newQty, stock, mode) {
const _totalProducts = countProducts();
console.log('totalProducts', _totalProducts)
const _newTotal = mode == 'sub' ? _totalProducts - 1 : _totalProducts + 1;
console.log('_newTotal', _newTotal)
const _limitReached = _newTotal > 4 || _newQty > stock;

console.log('limitReached', _limitReached)

if (!_limitReached) {
let _newProducts = [...selectedProducts];
_newProducts= _newProducts.filter(
Expand Down

0 comments on commit f77876e

Please sign in to comment.