Replace polling with server sent events

This commit is contained in:
2018-11-07 16:49:49 +09:00
parent e56782d5a3
commit 79da84956e
8 changed files with 108 additions and 117 deletions

View File

@ -38,6 +38,12 @@ func MarkNotificationsAsSeen(ctx *aero.Context) string {
notification.Save()
}
// Update the counter on all clients
user.BroadcastEvent(&aero.Event{
Name: "notificationCount",
Data: 0,
})
return "ok"
}