Skip to content

Commit

Permalink
update farms sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Feb 5, 2024
1 parent 1f46c98 commit cff6731
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/network/ergo/lm/api/farms/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@ export const farms$ = allFarms$.pipe(
),
),
map((farms) => uniqBy(farms, 'id')),
map((farms) =>
farms.sort((aFarm, bFarm) => {
if (
aFarm.status === FarmStatus.Scheduled &&
bFarm.status === FarmStatus.Scheduled
) {
return 0;
}
if (aFarm.status === FarmStatus.Scheduled) {
return -1;
}
if (bFarm.status === FarmStatus.Scheduled) {
return -1;
}
return 0;
}),
),
publishReplay(1),
refCount(),
);
Expand Down

0 comments on commit cff6731

Please sign in to comment.