show "followed by" on profile pages

This commit is contained in:
Martti Malmi
2023-11-24 16:18:32 +02:00
parent 47aec5437d
commit 13b76e7709
5 changed files with 56 additions and 8 deletions

View File

@ -211,6 +211,17 @@ export default class SocialGraph {
return count;
}
followedByFriends(address: HexKey) {
const id = ID(address);
const set = new Set<HexKey>();
for (const follower of this.followersByUser.get(id) ?? []) {
if (this.followedByUser.get(this.root)?.has(follower)) {
set.add(STR(follower));
}
}
return set;
}
getFollowedByUser(user: HexKey, includeSelf = false): Set<HexKey> {
const userId = ID(user);
const set = new Set<HexKey>();