ssb: Let about info load in its own time.

This commit is contained in:
Cory McWilliams 2025-05-09 07:27:35 -04:00
parent 02d789471f
commit 3eff1b08a9
2 changed files with 14 additions and 10 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&N/c9mpvJbvtyBsWoW+n9NtPMDRlQktALOGLSIyTeCW8=.sha256" "previous": "&3J6eTdwcXbt841IXTSh4plSLiHY1+n+iXNRuT76MfQs=.sha256"
} }

View File

@ -177,7 +177,6 @@ class TfElement extends LitElement {
users = users || {}; users = users || {};
for (let row of rows) { for (let row of rows) {
users[row.author] = Object.assign( users[row.author] = Object.assign(
{follow_depth: following[row.author]?.d},
users[row.author] || {}, users[row.author] || {},
JSON.parse(row.about) JSON.parse(row.about)
); );
@ -399,6 +398,7 @@ class TfElement extends LitElement {
blocking: v.ob, blocking: v.ob,
followed: v.if, followed: v.if,
blocked: v.ib, blocked: v.ib,
follow_depth: following[id]?.d,
}; };
by_count.push({count: v.of, id: id}); by_count.push({count: v.of, id: id});
} }
@ -409,14 +409,6 @@ class TfElement extends LitElement {
); );
this.following = Object.keys(following); this.following = Object.keys(following);
let about_start_time = new Date(); let about_start_time = new Date();
users = await this.fetch_about(following, users);
console.log(
'about took',
(new Date() - about_start_time) / 1000.0,
'seconds for',
Object.keys(users).length,
'users'
);
start_time = new Date(); start_time = new Date();
users = await this.fetch_user_info(users); users = await this.fetch_user_info(users);
console.log( console.log(
@ -425,6 +417,18 @@ class TfElement extends LitElement {
'seconds' 'seconds'
); );
this.users = users; this.users = users;
let self = this;
this.fetch_about(following, users).then(function(result) {
self.users = result;
console.log(
'about took',
(new Date() - about_start_time) / 1000.0,
'seconds for',
Object.keys(users).length,
'users'
);
});
console.log( console.log(
`load finished ${whoami} => ${this.whoami} in ${(new Date() - start_time) / 1000}` `load finished ${whoami} => ${this.whoami} in ${(new Date() - start_time) / 1000}`
); );