From 5d04711ed8765a014eee775db19e7069a39d452d Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Sun, 9 May 2021 20:48:05 +0300 Subject: [PATCH] Order weapons by XP if same count in X Trends Closes #489 --- services/xtrends.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/xtrends.ts b/services/xtrends.ts index 81356c805..b538bf687 100644 --- a/services/xtrends.ts +++ b/services/xtrends.ts @@ -76,7 +76,11 @@ const getXTrends = async (): Promise => { : ("UP" as const), }; }) - .sort((a, b) => b.count - a.count); + .sort((a, b) => { + if (a.count !== b.count) return b.count - a.count; + + return b.averageXp - a.averageXp; + }); return acc; },