Skip to content

Commit

Permalink
Fix build error (#59)
Browse files Browse the repository at this point in the history
Add spread operator to array to fix error

Co-authored-by: Pandelis Symeonidis <pandelis@kryha.io>
  • Loading branch information
Pandelissym and Pandelis Symeonidis authored Oct 18, 2023
1 parent 8430b07 commit 6e42170
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions frontend/src/pages/shop/items-shop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ export const ItemsShop: FC = () => {
const metrics = useGetItemMarketMetrics();
const [item] = useGetItemInShopById(selectedId);

const filteredItems = useMemo(()=>{
const filteredItems = useMemo(() => {
let toRemove = [] as ItemInMarket[];
let filtered = items;
if(EXCLUDE_ITEMS_SHOP.length){
for(const filter of EXCLUDE_ITEMS_SHOP){
toRemove = [...toRemove, items.filter(({ item }) => filter[0] === item.category && filter[1].includes(getRarityString(item.rarity)))];
if (EXCLUDE_ITEMS_SHOP.length) {
for (const filter of EXCLUDE_ITEMS_SHOP) {
toRemove = [
...toRemove,
...items.filter(({ item }) => filter[0] === item.category && filter[1].includes(getRarityString(item.rarity))),
];
}
filtered = items.filter((entry) => !toRemove.includes(entry));
};
Expand Down

0 comments on commit 6e42170

Please sign in to comment.