Make sure we don't have duplicates in the webchannel members

pull/1/head
yflory 7 years ago
parent f11960d047
commit ee605183e5

@ -97,6 +97,8 @@ define(['json.sortify'], function (Sortify) {
change(true); change(true);
}); });
sframeChan.on('EV_RT_JOIN', function (ev) { 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); members.push(ev);
if (!meta.user) { return; } if (!meta.user) { return; }
change(false); change(false);

Loading…
Cancel
Save