[lib.content-controller] better notification

This commit is contained in:
xdrm-brackets 2018-04-03 19:24:48 +02:00
parent 6dfa2b12e1
commit 225eef262e
1 changed files with 7 additions and 2 deletions

View File

@ -213,8 +213,13 @@ export default class ContentController{
}
/* (7) Notification API -> if not current channel */
if( room.messages.length > 0 && ri !== gs.get.content.rid )
new Notification(`${room.messages.length} new messages in #${room.name}`);
if( room.messages.length > 0 && ri !== gs.get.content.rid ){
let title = `Room #${room.name}`;
let body = `${room.messages.length} new messages`;
new Notification(title, { body: body });
}
}