about summary refs log tree commit diff
path: root/src/state/models/me.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/me.ts')
-rw-r--r--src/state/models/me.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/state/models/me.ts b/src/state/models/me.ts
index 0a3627217..9e0c897ed 100644
--- a/src/state/models/me.ts
+++ b/src/state/models/me.ts
@@ -6,6 +6,7 @@ export class MeModel {
   name?: string
   displayName?: string
   description?: string
+  notificationCount: number = 0
 
   constructor(public rootStore: RootStoreModel) {
     makeAutoObservable(this, {rootStore: false}, {autoBind: true})
@@ -16,6 +17,7 @@ export class MeModel {
     this.name = undefined
     this.displayName = undefined
     this.description = undefined
+    this.notificationCount = 0
   }
 
   async load() {
@@ -39,4 +41,11 @@ export class MeModel {
       this.clear()
     }
   }
+
+  async fetchStateUpdate() {
+    const res = await this.rootStore.api.todo.social.getNotificationCount({})
+    runInAction(() => {
+      this.notificationCount = res.data.count
+    })
+  }
 }