From 225eef262e757fd52c1d4e509b44aad6a971f1c7 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 3 Apr 2018 19:24:48 +0200 Subject: [PATCH] [lib.content-controller] better notification --- webpack/lib/content-controller.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webpack/lib/content-controller.js b/webpack/lib/content-controller.js index c00592a..42c343d 100644 --- a/webpack/lib/content-controller.js +++ b/webpack/lib/content-controller.js @@ -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 }); + + } }