Skip to content

Commit

Permalink
add unsensitive on the filter
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Jan 10, 2024
1 parent fb617b4 commit b6ff05f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/helpers/pile-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ export function getPriceFromString(str, currencyList = false) {
for (const currency of currencies) {

if(part[2]) {
identifierFilter.push(part[2]);
identifierFilter.push(part[2]?.toLowerCase());
}

if (part[2] !== currency.identifier) continue;
Expand All @@ -876,7 +876,7 @@ export function getPriceFromString(str, currencyList = false) {
}

// Maybe there is a better method for this ?
currencies = currencies.filter(currency => identifierFilter.includes(currency.identifier));
currencies = currencies.filter(currency => identifierFilter.includes(currency.identifier?.toLowerCase()));

if (!currencies.some(currency => Helpers.isRealNumber(currency.quantity) && currency.quantity >= 0)) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function hasItemCost(item) {
}

/**
* Returns a given item's quantity
* Returns a given item's cost/price
*
* @param {Object} itemData
* @param {Number} cost
Expand Down

0 comments on commit b6ff05f

Please sign in to comment.