about summary refs log tree commit diff
path: root/src/state/models
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-04-18 18:29:54 -0500
committerGitHub <noreply@github.com>2023-04-18 18:29:54 -0500
commit75fd653be3a391d0edc11a9b35ed636c7cbe3b11 (patch)
tree38fc788652cac037df991be73d87eba263dc683f /src/state/models
parent1ab8f315179cc1c93f1319b0e6fb1f75aa1c5954 (diff)
downloadvoidsky-75fd653be3a391d0edc11a9b35ed636c7cbe3b11.tar.zst
Rework search suggestions for performance (#492)
Diffstat (limited to 'src/state/models')
-rw-r--r--src/state/models/discovery/foafs.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/state/models/discovery/foafs.ts b/src/state/models/discovery/foafs.ts
index 8dac2ec2d..f6e3157b7 100644
--- a/src/state/models/discovery/foafs.ts
+++ b/src/state/models/discovery/foafs.ts
@@ -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({