Rework search suggestions for performance (#492)

This commit is contained in:
Paul Frazee 2023-04-18 18:29:54 -05:00 committed by GitHub
parent 1ab8f31517
commit 75fd653be3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 312 additions and 448 deletions

View file

@ -57,15 +57,19 @@ export class FoafsModel {
}
// grab 10 of the users followed by the user
this.sources = sampleSize(
Object.keys(this.rootStore.me.follows.followDidToRecordMap),
10,
)
runInAction(() => {
this.sources = sampleSize(
Object.keys(this.rootStore.me.follows.followDidToRecordMap),
10,
)
})
if (this.sources.length === 0) {
return
}
this.foafs.clear()
this.popular.length = 0
runInAction(() => {
this.foafs.clear()
this.popular.length = 0
})
// fetch their profiles
const profiles = await this.rootStore.agent.getProfiles({