From 376ed6d44ffe87529bdb682a86e9eaced6f26da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5var=20Aamb=C3=B8=20Fosstveit?= Date: Mon, 23 Mar 2020 23:56:36 +0100 Subject: [PATCH] Cleanup --- app/src/Spotlights.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/app/src/Spotlights.js b/app/src/Spotlights.js index a680f5e..30dc48a 100644 --- a/app/src/Spotlights.js +++ b/app/src/Spotlights.js @@ -116,19 +116,9 @@ export default class Spotlights extends EventEmitter logger.debug( 'room "peerClosed" event [peerId:%o]', id); - let index = this._peerList.indexOf(id); + this._peerList = this._peerList.filter((peer) => peer !== id); - if (index !== -1) // We have this peer in the list, remove - { - this._peerList.splice(index, 1); - } - - index = this._selectedSpotlights.indexOf(id); - - if (index !== -1) // We have this peer in the list, remove - { - this._selectedSpotlights.splice(index, 1); - } + this._selectedSpotlights = this._selectedSpotlights.filter((peer) => peer !== id); if (this._started) this._spotlightsUpdated();