Implement notifications

This commit is contained in:
Paul Frazee 2022-10-03 10:53:36 -05:00
parent b05a334dcb
commit c7d7e152a0
16 changed files with 456 additions and 81 deletions

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
})
}
}