diff --git a/app/src/Spotlights.js b/app/src/Spotlights.js index c462f09..83e9905 100644 --- a/app/src/Spotlights.js +++ b/app/src/Spotlights.js @@ -49,27 +49,39 @@ export default class Spotlights extends EventEmitter setNextAsSelected() { let peerId = null; - if (this._selectedSpotlights.length > 0) { + + if (this._selectedSpotlights.length > 0) + { peerId = this._selectedSpotlights[0]; - } else if (this._unmutablePeerList.length > 0) { + } + else if (this._unmutablePeerList.length > 0) + { peerId = this._unmutablePeerList[0]; } - if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) { - let oldIndex = this._unmutablePeerList.indexOf(peerId); + if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) + { + const oldIndex = this._unmutablePeerList.indexOf(peerId); + let index = oldIndex; + index++; - do { - if (index >= this._unmutablePeerList.length) { + do + { + if (index >= this._unmutablePeerList.length) + { index = 0; } - let newSelectedPeer = this._unmutablePeerList[index]; - if (!this._currentSpotlights.includes(newSelectedPeer)) { + const newSelectedPeer = this._unmutablePeerList[index]; + + if (!this._currentSpotlights.includes(newSelectedPeer)) + { this.setPeerSpotlight(newSelectedPeer); break; } index++; - if (index === oldIndex) { + if (index === oldIndex) + { break; } } while (true); @@ -79,27 +91,39 @@ export default class Spotlights extends EventEmitter setPrevAsSelected() { let peerId = null; - if (this._selectedSpotlights.length > 0) { + + if (this._selectedSpotlights.length > 0) + { peerId = this._selectedSpotlights[0]; - } else if (this._unmutablePeerList.length > 0) { + } + else if (this._unmutablePeerList.length > 0) + { peerId = this._unmutablePeerList[0]; } - if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) { - let oldIndex = this._unmutablePeerList.indexOf(peerId); + if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) + { + const oldIndex = this._unmutablePeerList.indexOf(peerId); + let index = oldIndex; + index--; - do { - if (index < 0) { + do + { + if (index < 0) + { index = this._unmutablePeerList.length - 1; } - let newSelectedPeer = this._unmutablePeerList[index]; - if (!this._currentSpotlights.includes(newSelectedPeer)) { + const newSelectedPeer = this._unmutablePeerList[index]; + + if (!this._currentSpotlights.includes(newSelectedPeer)) + { this.setPeerSpotlight(newSelectedPeer); break; } index--; - if (index === oldIndex) { + if (index === oldIndex) + { break; } } while (true); diff --git a/app/src/components/Controls/Help.js b/app/src/components/Controls/Help.js index 534f3e2..ab188b8 100644 --- a/app/src/components/Controls/Help.js +++ b/app/src/components/Controls/Help.js @@ -24,7 +24,7 @@ const shortcuts=[ { key: '2', label: 'label.filmstrip', defaultMessage: 'Filmstrip View' }, { key: 'space', label: 'me.mutedPTT', defaultMessage: 'Push SPACE to talk' }, { key: 'a', label: 'label.advanced', defaultMessage: 'Show advanced information' }, - { key: String.fromCharCode(8592)+' '+String.fromCharCode(8594), label: 'room.browsePeersSpotlight', defaultMessage: 'Browse participants into Spotlight' } + { key: `${String.fromCharCode(8592)} ${String.fromCharCode(8594)}`, label: 'room.browsePeersSpotlight', defaultMessage: 'Browse participants into Spotlight' } ]; const styles = (theme) => ({ diff --git a/app/src/index.js b/app/src/index.js index 0a9228c..c5f333d 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -50,34 +50,36 @@ const cache = createIntlCache(); const messages = { // 'en' : messagesEnglish, - 'nb' : messagesNorwegian, - 'de' : messagesGerman, - 'hu' : messagesHungarian, - 'pl' : messagesPolish, - 'dk' : messagesDanish, - 'fr' : messagesFrench, - 'el' : messagesGreek, - 'ro' : messagesRomanian, - 'pt' : messagesPortuguese, + 'nb' : messagesNorwegian, + 'de' : messagesGerman, + 'hu' : messagesHungarian, + 'pl' : messagesPolish, + 'dk' : messagesDanish, + 'fr' : messagesFrench, + 'el' : messagesGreek, + 'ro' : messagesRomanian, + 'pt' : messagesPortuguese, 'zh-hans' : messagesChineseSimplified, 'zh-hant' : messagesChineseTraditional, - 'es' : messagesSpanish, - 'hr' : messagesCroatian, - 'cs' : messagesCzech, - 'it' : messagesItalian, - 'uk' : messagesUkrainian, - 'tr' : messagesTurkish, - 'lv' : messagesLatvian + 'es' : messagesSpanish, + 'hr' : messagesCroatian, + 'cs' : messagesCzech, + 'it' : messagesItalian, + 'uk' : messagesUkrainian, + 'tr' : messagesTurkish, + 'lv' : messagesLatvian }; -let browserLanguage = (navigator.language || navigator.browserLanguage).toLowerCase() +const browserLanguage = (navigator.language || navigator.browserLanguage).toLowerCase(); + let locale = browserLanguage.split(/[-_]/)[0]; // language without region code + if (locale === 'zh') { if (browserLanguage === 'zh-cn') - locale = 'zh-hans' + locale = 'zh-hans'; else - locale = 'zh-hant' + locale = 'zh-hant'; } const intl = createIntl({