A
A
Alexey Vardugin2016-03-14 10:38:16
Angular
Alexey Vardugin, 2016-03-14 10:38:16

How to correctly implement the counter of unread messages?

It is necessary to display the number of unread messages in me next to the 'inbox' item. I receive the message from the backend using Restangular. There is an unreadCount method that returns the number of unread messages. A message is considered read if the user went to the body of this message or marked it as read. How to update the counter correctly if a new message arrives?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-03-14
Protko @Fesor

First, define a "read message" definition. When it should be considered read. And then do it from there.
ps is not unreadCount but countUnread, so it somehow sounds nicer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question