From ca3e25b0e7d85269f7b1c800b8ec8714ec786da1 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 7 Dec 2017 22:48:28 +0100 Subject: [PATCH] upd: view.websocket (not array contat, now object merging) --- view/websocket.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/view/websocket.js b/view/websocket.js index b73de39..207269b 100644 --- a/view/websocket.js +++ b/view/websocket.js @@ -24,7 +24,9 @@ window.wsc_emergency = wsc.channel('emergency/31').listen(function(msg, err){ ( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play(); // {2} Add messages to stack // - gstore.data.notif.emergency.data = gstore.data.notif.emergency.data.concat( msg.add ); + for( var id in msg.add ) + if( gstore.data.notif.emergency.data[id] == null ) + gstore.data.notif.emergency.data[id] = msg.add[id]; // {3} Add notification count if not already on page // if( router.app.$route.path != '/emergency' ) @@ -80,7 +82,9 @@ window.wsc_event = wsc.channel('event/31').listen(function(msg, err){ ( new Audio('https://notificationsounds.com/message-tones/communication-channel-519/download/mp3') ).play(); // {2} Add messages to stack // - gstore.data.notif.event.data = gstore.data.notif.event.data.concat( msg.add ); + for( var id in msg.add ) + if( gstore.data.notif.event.data[id] == null ) + gstore.data.notif.event.data[id] = msg.add[id]; // {3} Add notification count if not already on page // if( router.app.$route.path != '/event' )