From 487f97e7e56a6934f1b0c9438f6d66f3785d0a3b Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Fri, 19 Mar 2021 23:32:53 +0530 Subject: [PATCH] idk --- src/ws/handler.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ws/handler.js b/src/ws/handler.js index d1ee0fa..6f5a1b7 100644 --- a/src/ws/handler.js +++ b/src/ws/handler.js @@ -50,7 +50,6 @@ const handleMsg = async (msg, id) => { dm = await crud[channel].create(d.data) recvUpdate(channel, dm) fanoutMsg(channel, await crud[channel].getAll()) - fanoutMsg(channel, await crud[channel].getAll()) break; case 'update': dm = await crud[channel].update(d.data.id, d.data.data) @@ -77,10 +76,10 @@ const fanoutMsg = (channel, data) => { data, } connections[k].connection.send(JSON.stringify(d)) - } else if (connections[k].events.indexOf(`streams:full`) !== -1) { + } else if (connections[k].events.indexOf('streams:full') !== -1) { const d = { - event: `streams:full`, - data, + event: 'streams:full', + data: await crud['streams'].getAllPop(), } connections[k].connection.send(JSON.stringify(d)) }