Fix sorting relays by score
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "paravel",
|
"name": "paravel",
|
||||||
"version": "0.5.6",
|
"version": "0.5.7",
|
||||||
"description": "Yet another toolkit for nostr",
|
"description": "Yet another toolkit for nostr",
|
||||||
"author": "hodlbod",
|
"author": "hodlbod",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
+2
-1
@@ -72,7 +72,8 @@ export class Router {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const items = Object.entries(scores)
|
const items = Object.entries(scores)
|
||||||
.sort((a, b) => a[1].score > b[1].score ? -1 : 1)
|
.filter(([url, {score}]) => score > 0)
|
||||||
|
.sort((a, b) => b[1].score - a[1].score)
|
||||||
.map(([url, {score, count}]) => ({url, score, count}))
|
.map(([url, {score, count}]) => ({url, score, count}))
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
|||||||
Reference in New Issue
Block a user