From 5e7f77c74728bfa9d034d127e032e8f9aaa93c81 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus Date: Fri, 20 Dec 2024 19:28:31 +1100 Subject: [PATCH] fligter --- .../ui/components/trading/ResourceArrivals.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/client/src/ui/components/trading/ResourceArrivals.tsx b/client/src/ui/components/trading/ResourceArrivals.tsx index 807a71719..a40593b8a 100644 --- a/client/src/ui/components/trading/ResourceArrivals.tsx +++ b/client/src/ui/components/trading/ResourceArrivals.tsx @@ -46,8 +46,10 @@ export const AllResourceArrivals = memo( const whitelistedGuilds = useMemo(() => { return [ - ...(savedGuilds?.flatMap((guildId) => getPlayerListInGuild(Number(guildId))) || []), - ...getPlayersInPlayersGuild(BigInt(account?.address || 0n)).map((player) => player.address), + ...(savedGuilds + ?.flatMap((guildId) => getPlayerListInGuild(Number(guildId))) + .map((player) => BigInt(player.address)) || []), + ...getPlayersInPlayersGuild(BigInt(account?.address || 0n)).map((player) => BigInt(player.address)), ]; }, [account?.address, savedGuilds]); @@ -57,7 +59,9 @@ export const AllResourceArrivals = memo( const newIdsSet = new Set( arrivals .filter( - (arrival) => whitelistedGuilds.includes(arrival.originOwner) || arrival.originOwner === account.address, + (arrival) => + whitelistedGuilds.includes(BigInt(arrival.originOwner)) || + BigInt(arrival.originOwner) === BigInt(account.address), ) .map((arrival) => arrival.entityId.toString()), ); @@ -77,7 +81,9 @@ export const AllResourceArrivals = memo( console.log("AddToSubscriptionStart - 5"); }, [arrivals, subscribedIds, addSubscribedIds]); - const guildPlayers = getPlayersInPlayersGuild(BigInt(account?.address || 0n)).map((player) => player.address); + const guildPlayers = getPlayersInPlayersGuild(BigInt(account?.address || 0n)).map((player) => + BigInt(player.address), + ); const filteredArrivals = useMemo( () => @@ -87,7 +93,7 @@ export const AllResourceArrivals = memo( const guildCondition = showOnlyGuildMembers ? guildPlayers.length === 0 ? true // If no guild players, show all arrivals - : guildPlayers.includes(arrival.originOwner) + : guildPlayers.includes(BigInt(arrival.originOwner)) : true; return timeCondition && guildCondition; }),