From ac3537b9951661cb3aae00cddc744fceda8726df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5var=20Aamb=C3=B8=20Fosstveit?= Date: Tue, 30 Oct 2018 09:00:43 +0100 Subject: [PATCH] Only one forced spotlight possible --- app/lib/Spotlights.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/lib/Spotlights.js b/app/lib/Spotlights.js index dd90895..8b91e99 100644 --- a/app/lib/Spotlights.js +++ b/app/lib/Spotlights.js @@ -50,6 +50,16 @@ export default class Spotlights extends EventEmitter const index = this._selectedSpotlights.indexOf(peerName); + if (index !== -1) + { + this._selectedSpotlights = []; + } + else + { + this._selectedSpotlights = [ peerName ]; + } + + /* if (index === -1) // We don't have this peer in the list, adding { this._selectedSpotlights.push(peerName); @@ -58,6 +68,7 @@ export default class Spotlights extends EventEmitter { this._selectedSpotlights.splice(index, 1); } + */ if (this._started) this._spotlightsUpdated();