Clear notifications count optimistically
parent
92046473f8
commit
bd1a4b198e
|
@ -49,6 +49,10 @@ export class MeModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearNotificationCount() {
|
||||||
|
this.notificationCount = 0
|
||||||
|
}
|
||||||
|
|
||||||
async fetchStateUpdate() {
|
async fetchStateUpdate() {
|
||||||
const res = await this.rootStore.api.app.bsky.notification.getCount()
|
const res = await this.rootStore.api.app.bsky.notification.getCount()
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
|
|
|
@ -332,6 +332,7 @@ export class NotificationsViewModel {
|
||||||
await this.rootStore.api.app.bsky.notification.updateSeen({
|
await this.rootStore.api.app.bsky.notification.updateSeen({
|
||||||
seenAt: new Date().toISOString(),
|
seenAt: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
|
this.rootStore.me.clearNotificationCount()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Failed to update notifications read state', e)
|
console.log('Failed to update notifications read state', e)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue