diff --git a/src/ws/handler.js b/src/ws/handler.js index b11aa30..47aa53a 100644 --- a/src/ws/handler.js +++ b/src/ws/handler.js @@ -34,6 +34,7 @@ const handleMsg = async (msg, id) => { data: await crud[channel].getAll(), } if (channel === 'streams' && d.subscribe === 'streams:full') { + dm.event = 'streams:full' dm.data = await crud[channel].getAllPop() } connections[id].connection.send(JSON.stringify(dm)) @@ -75,6 +76,12 @@ const fanoutMsg = (channel, data) => { data, } connections[k].connection.send(JSON.stringify(d)) + } else if (connections[k].events.indexOf(`streams:full`) !== -1) { + const d = { + event: `streams:full`, + data, + } + connections[k].connection.send(JSON.stringify(d)) } }) }