diff --git a/frontend/src/pages/shop/items-shop.tsx b/frontend/src/pages/shop/items-shop.tsx index f966706f1..da96fe502 100644 --- a/frontend/src/pages/shop/items-shop.tsx +++ b/frontend/src/pages/shop/items-shop.tsx @@ -31,21 +31,20 @@ export const ItemsShop: FC = () => { ]; } filtered = items.filter((entry) => !toRemove.includes(entry)); - }; + } return filtered; }, [items]); - - const metricsData = useMemo(()=>{ + const metricsData = useMemo(() => { if (metrics) { let itemAverage = 0; let itemMinimum = 0; - + if (filteredItems.length != 0) { itemMinimum = findMinimumValue(filteredItems.map((x) => uISTToIST(Number(x.sell.price)))); itemAverage = findAverageValue(filteredItems.map((x) => uISTToIST(Number(x.sell.price)))); } - + return [ metrics.amountSold, metrics.collectionSize, @@ -56,7 +55,7 @@ export const ItemsShop: FC = () => { ]; } return []; - }, [filteredItems]); + }, [metrics, filteredItems]); if (!filteredItems) return <>; const assetsCount = filteredItems.length; @@ -66,9 +65,9 @@ export const ItemsShop: FC = () => { {metrics ? : <>} + Market: {text.param.amountOfItems(assetsCount)} + - Market: {text.param.amountOfItems(assetsCount)} - {selectedId && item && setSelectedId(id)} />} {filteredItems.length > 0 ? ( setSelectedId(id)} />