about summary refs log tree commit diff
path: root/src/state/models/root-store.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/root-store.ts')
-rw-r--r--src/state/models/root-store.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts
index 33f4f4085..a6ef28166 100644
--- a/src/state/models/root-store.ts
+++ b/src/state/models/root-store.ts
@@ -38,6 +38,17 @@ export class RootStoreModel {
     return res.data.did
   }
 
+  async fetchStateUpdate() {
+    if (!this.session.isAuthed) {
+      return
+    }
+    try {
+      await this.me.fetchStateUpdate()
+    } catch (e) {
+      console.error('Failed to fetch latest state', e)
+    }
+  }
+
   serialize(): unknown {
     return {
       session: this.session.serialize(),