Skip to content

Commit

Permalink
handle notQualified nodes too
Browse files Browse the repository at this point in the history
  • Loading branch information
radumojic committed Apr 2, 2024
1 parent 1e6687f commit 6b38d92
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/pages/NodesAuctionList/NodesAuctionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,31 @@ export const NodesAuctionList = () => {

Promise.all([...nodesPromiseArray, getNodesCount(auctionListFilters)]).then(
([firstNodes, secondNodes, count]) => {
const qualiNodes = firstNodes.data
const qualifiedNodes = firstNodes.data
? firstNodes.data.filter(
(node: NodeType) => node.auctionQualified && !node.isInDangerZone
)
: [];
const dzNodes = firstNodes.data
? firstNodes.data.filter((node: NodeType) => node.isInDangerZone)
: [];
const notQualifiedNodes = firstNodes.data
? firstNodes.data.filter(
(node: NodeType) => !node.auctionQualified && !node.isInDangerZone
)
: [];
const sortedFirst = [
...(sort.order === SortOrderEnum.asc
? [...(dzNodes ?? []), ...(qualiNodes ?? [])]
: [...(qualiNodes ?? []), ...(dzNodes ?? [])])
? [
...(notQualifiedNodes ?? []),
...(dzNodes ?? []),
...(qualifiedNodes ?? [])
]
: [
...(qualifiedNodes ?? []),
...(dzNodes ?? []),
...(notQualifiedNodes ?? [])
])
];
const allNodes = [
...(sort.order === SortOrderEnum.asc
Expand Down

0 comments on commit 6b38d92

Please sign in to comment.