Implement notifications
This commit is contained in:
parent
b05a334dcb
commit
c7d7e152a0
16 changed files with 456 additions and 81 deletions
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue