From ee605183e5346ad51fe86f1b3654a337c792f832 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 15 Jan 2018 15:40:52 +0100 Subject: [PATCH] Make sure we don't have duplicates in the webchannel members --- www/common/metadata-manager.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/common/metadata-manager.js b/www/common/metadata-manager.js index bf99e4b84..0ec1c07ea 100644 --- a/www/common/metadata-manager.js +++ b/www/common/metadata-manager.js @@ -97,6 +97,8 @@ define(['json.sortify'], function (Sortify) { change(true); }); sframeChan.on('EV_RT_JOIN', function (ev) { + var idx = members.indexOf(ev); + if (idx !== -1) { console.log('Error: ' + ev + ' is already in members'); return; } members.push(ev); if (!meta.user) { return; } change(false);