Hitting some limit with following too many people. Working around it.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4610 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-11-05 13:07:07 +00:00
parent 6ef14d985d
commit aa10ab69f6
3 changed files with 39 additions and 31 deletions

View File

@ -212,8 +212,8 @@ class TfElement extends LitElement {
let whoami = this.whoami;
let tags = this.load_recent_tags();
let following = await tfrpc.rpc.following([whoami], 2);
console.log(following);
let users = {};
let by_count = [];
for (let [id, v] of Object.entries(following)) {
users[id] = {
following: v.of,
@ -221,7 +221,9 @@ class TfElement extends LitElement {
followed: v.if,
blocked: v.ib,
};
by_count.push({count: v.of, id: id});
}
console.log(by_count.sort((x, y) => y.count - x.count).slice(0, 20));
users = await this.fetch_about(Object.keys(following).sort(), users);
this.following = Object.keys(following);
this.users = users;