Sort livestreams per viewCount, descending
This commit is contained in:
parent
61d0d76c1c
commit
dc46af34ec
1 changed files with 8 additions and 0 deletions
|
@ -52,6 +52,14 @@ export function getLivestreamUris(
|
|||
values = values.filter((v) => !excludedChannelIds.includes(v.creatorId));
|
||||
}
|
||||
|
||||
values = values.sort((a, b) => {
|
||||
// $FlowFixMe
|
||||
if (a.viewCount < b.viewCount) return 1;
|
||||
// $FlowFixMe
|
||||
else if (a.viewCount > b.viewCount) return -1;
|
||||
else return 0;
|
||||
});
|
||||
|
||||
// $FlowFixMe
|
||||
return values.map((v) => v.claimUri);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue