From 834843e6179c94e25157f50d94c3ed3b41802b0b Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Thu, 28 Mar 2019 19:54:51 -0400 Subject: bug with liveupdates adding duplicate points --- web/public/javascripts/map.js | 2 +- web/routes/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/public/javascripts/map.js b/web/public/javascripts/map.js index 17b9208..5b75bc3 100644 --- a/web/public/javascripts/map.js +++ b/web/public/javascripts/map.js @@ -178,7 +178,7 @@ if (window.EventSource) { var data = JSON.parse(e.data); if (data.coordinates) { points.push(data); - plotPointsOnMap(points); + plotPointsOnMap(data); } }, false) diff --git a/web/routes/index.js b/web/routes/index.js index 2633c04..2a828bc 100644 --- a/web/routes/index.js +++ b/web/routes/index.js @@ -47,7 +47,7 @@ router.post('/mobilerequest', function(req, res) { } else { // send event to all connections for(var i = 0; i < connections.length; i++) { - connections[i].sseSend(point); + connections[i].sseSend(result); } console.log(result); res.status(201).send({'status': 'success'}); -- cgit v1.2.3