mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Display the number of notifications on page title.
This commit is contained in:
@ -22,8 +22,11 @@ ComunicWeb.components.notifications.service = {
|
||||
var interval = setInterval(function(){
|
||||
|
||||
//Auto-remove interval if the target has been removed
|
||||
if(!target.isConnected)
|
||||
if(!target.isConnected){
|
||||
ComunicWeb.common.pageTitle.setNotificationsNumber(0);
|
||||
return clearInterval(interval);
|
||||
}
|
||||
|
||||
|
||||
//Get the number of notifications from the API
|
||||
ComunicWeb.components.notifications.interface.getAllUnread(function(response){
|
||||
@ -55,6 +58,8 @@ ComunicWeb.components.notifications.service = {
|
||||
|
||||
}
|
||||
|
||||
//Update page title too
|
||||
ComunicWeb.common.pageTitle.setNotificationsNumber(response.notifications + response.conversations);
|
||||
});
|
||||
|
||||
}, 2000);
|
||||
|
Reference in New Issue
Block a user