upd: view.websocket (not array contat, now object merging)

This commit is contained in:
xdrm-brackets 2017-12-07 22:48:28 +01:00
parent dc167766fa
commit ca3e25b0e7
1 changed files with 6 additions and 2 deletions

View File

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