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

pull/1/head
yflory 2018-01-15 15:40:52 +01:00
parent f11960d047
commit ee605183e5
1 changed files with 2 additions and 0 deletions

View File

@ -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);