Implement notifications

This commit is contained in:
Paul Frazee
2022-10-03 10:53:36 -05:00
parent 5b8d0957b3
commit a77988a984
16 changed files with 456 additions and 81 deletions
+9
View File
@@ -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
})
}
}