Skip to content

Commit

Permalink
fix follows list sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Jul 27, 2023
1 parent af8d75b commit bea7274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/js/nostr/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/js/views/Follows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit bea7274

Please sign in to comment.