From bea7274c7aec62e04ed6d501549e825254ef1dff Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Thu, 27 Jul 2023 13:38:02 +0300 Subject: [PATCH] fix follows list sorting --- src/js/nostr/Events.ts | 1 - src/js/views/Follows.tsx | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/js/nostr/Events.ts b/src/js/nostr/Events.ts index 738f88a57..045c6e747 100644 --- a/src/js/nostr/Events.ts +++ b/src/js/nostr/Events.ts @@ -819,7 +819,6 @@ const Events = { // Add "note to self" chat so the list is not empty map.set(Key.getPubKey(), new SortedLimitedEventSet(500)); } - console.log('direct messages', map); cb?.(map); }; callback(); diff --git a/src/js/views/Follows.tsx b/src/js/views/Follows.tsx index fd0dba176..4a7644d0d 100644 --- a/src/js/views/Follows.tsx +++ b/src/js/views/Follows.tsx @@ -47,8 +47,8 @@ class Follows extends View { } sortByName(aK, bK) { - const aName = SocialNetwork.profiles.get(aK)?.name; - const bName = SocialNetwork.profiles.get(bK)?.name; + const aName = SocialNetwork.profiles.get(ID(aK))?.name; + const bName = SocialNetwork.profiles.get(ID(bK))?.name; if (!aName && !bName) { return aK.localeCompare(bK); } @@ -62,8 +62,8 @@ class Follows extends View { } sortByFollowDistance(aK, bK) { - const aDistance = SocialNetwork.followDistanceByUser.get(aK); - const bDistance = SocialNetwork.followDistanceByUser.get(bK); + const aDistance = SocialNetwork.followDistanceByUser.get(ID(aK)); + const bDistance = SocialNetwork.followDistanceByUser.get(ID(bK)); if (aDistance === bDistance) { return this.sortByName(aK, bK); }