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

@ -16,7 +16,11 @@ export default class NotificationManager {
})
let body = await response.text()
this.unseen = parseInt(body)
this.setCounter(parseInt(body))
}
setCounter(unseen: number) {
this.unseen = unseen
if(isNaN(this.unseen)) {
this.unseen = 0