Skip to content

Commit

Permalink
[dashboard] Fix faucet filter in chainlist page (#3859)
Browse files Browse the repository at this point in the history
  • Loading branch information
MananTank authored Jul 29, 2024
1 parent 5f8c797 commit f31e211
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions apps/dashboard/src/app/(dashboard)/(chain)/chainlist/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,18 @@ async function getChainsToRender(params: SearchParams) {
const urlServiceArray = Array.isArray(params.service)
? params.service
: [params.service];

// if the chain does not have all of the services in the filter, return false to filter it out
if (
!urlServiceArray.every((service) =>
chain.services.find((s) => s.enabled && s.service === service),
)
!urlServiceArray.every((service) => {
// TODO improve this
// We don't have "faucet" added in services array, so for now we just check if it's testnet or not
if (service === "faucet") {
return chain.testnet;
}

return chain.services.find((s) => s.enabled && s.service === service);
})
) {
// skip to the next chain
continue;
Expand Down

0 comments on commit f31e211

Please sign in to comment.