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' )