Clear notifications count optimistically

This commit is contained in:
Paul Frazee
2022-11-16 14:36:16 -06:00
parent aa7a5964f2
commit bf7581e8e3
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -49,6 +49,10 @@ export class MeModel {
}
}
clearNotificationCount() {
this.notificationCount = 0
}
async fetchStateUpdate() {
const res = await this.rootStore.api.app.bsky.notification.getCount()
runInAction(() => {
+1
View File
@@ -332,6 +332,7 @@ export class NotificationsViewModel {
await this.rootStore.api.app.bsky.notification.updateSeen({
seenAt: new Date().toISOString(),
})
this.rootStore.me.clearNotificationCount()
} catch (e) {
console.log('Failed to update notifications read state', e)
}