fix lint
parent
ba8efb19ff
commit
a1d348eefc
|
|
@ -49,27 +49,39 @@ export default class Spotlights extends EventEmitter
|
||||||
setNextAsSelected()
|
setNextAsSelected()
|
||||||
{
|
{
|
||||||
let peerId = null;
|
let peerId = null;
|
||||||
if (this._selectedSpotlights.length > 0) {
|
|
||||||
|
if (this._selectedSpotlights.length > 0)
|
||||||
|
{
|
||||||
peerId = this._selectedSpotlights[0];
|
peerId = this._selectedSpotlights[0];
|
||||||
} else if (this._unmutablePeerList.length > 0) {
|
}
|
||||||
|
else if (this._unmutablePeerList.length > 0)
|
||||||
|
{
|
||||||
peerId = this._unmutablePeerList[0];
|
peerId = this._unmutablePeerList[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) {
|
if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length)
|
||||||
let oldIndex = this._unmutablePeerList.indexOf(peerId);
|
{
|
||||||
|
const oldIndex = this._unmutablePeerList.indexOf(peerId);
|
||||||
|
|
||||||
let index = oldIndex;
|
let index = oldIndex;
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
do {
|
do
|
||||||
if (index >= this._unmutablePeerList.length) {
|
{
|
||||||
|
if (index >= this._unmutablePeerList.length)
|
||||||
|
{
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
let newSelectedPeer = this._unmutablePeerList[index];
|
const newSelectedPeer = this._unmutablePeerList[index];
|
||||||
if (!this._currentSpotlights.includes(newSelectedPeer)) {
|
|
||||||
|
if (!this._currentSpotlights.includes(newSelectedPeer))
|
||||||
|
{
|
||||||
this.setPeerSpotlight(newSelectedPeer);
|
this.setPeerSpotlight(newSelectedPeer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
if (index === oldIndex) {
|
if (index === oldIndex)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
@ -79,27 +91,39 @@ export default class Spotlights extends EventEmitter
|
||||||
setPrevAsSelected()
|
setPrevAsSelected()
|
||||||
{
|
{
|
||||||
let peerId = null;
|
let peerId = null;
|
||||||
if (this._selectedSpotlights.length > 0) {
|
|
||||||
|
if (this._selectedSpotlights.length > 0)
|
||||||
|
{
|
||||||
peerId = this._selectedSpotlights[0];
|
peerId = this._selectedSpotlights[0];
|
||||||
} else if (this._unmutablePeerList.length > 0) {
|
}
|
||||||
|
else if (this._unmutablePeerList.length > 0)
|
||||||
|
{
|
||||||
peerId = this._unmutablePeerList[0];
|
peerId = this._unmutablePeerList[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) {
|
if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length)
|
||||||
let oldIndex = this._unmutablePeerList.indexOf(peerId);
|
{
|
||||||
|
const oldIndex = this._unmutablePeerList.indexOf(peerId);
|
||||||
|
|
||||||
let index = oldIndex;
|
let index = oldIndex;
|
||||||
|
|
||||||
index--;
|
index--;
|
||||||
do {
|
do
|
||||||
if (index < 0) {
|
{
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
index = this._unmutablePeerList.length - 1;
|
index = this._unmutablePeerList.length - 1;
|
||||||
}
|
}
|
||||||
let newSelectedPeer = this._unmutablePeerList[index];
|
const newSelectedPeer = this._unmutablePeerList[index];
|
||||||
if (!this._currentSpotlights.includes(newSelectedPeer)) {
|
|
||||||
|
if (!this._currentSpotlights.includes(newSelectedPeer))
|
||||||
|
{
|
||||||
this.setPeerSpotlight(newSelectedPeer);
|
this.setPeerSpotlight(newSelectedPeer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index--;
|
index--;
|
||||||
if (index === oldIndex) {
|
if (index === oldIndex)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (true);
|
} while (true);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const shortcuts=[
|
||||||
{ key: '2', label: 'label.filmstrip', defaultMessage: 'Filmstrip View' },
|
{ key: '2', label: 'label.filmstrip', defaultMessage: 'Filmstrip View' },
|
||||||
{ key: 'space', label: 'me.mutedPTT', defaultMessage: 'Push SPACE to talk' },
|
{ key: 'space', label: 'me.mutedPTT', defaultMessage: 'Push SPACE to talk' },
|
||||||
{ key: 'a', label: 'label.advanced', defaultMessage: 'Show advanced information' },
|
{ 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) =>
|
const styles = (theme) =>
|
||||||
({
|
({
|
||||||
|
|
|
||||||
|
|
@ -50,34 +50,36 @@ const cache = createIntlCache();
|
||||||
const messages =
|
const messages =
|
||||||
{
|
{
|
||||||
// 'en' : messagesEnglish,
|
// 'en' : messagesEnglish,
|
||||||
'nb' : messagesNorwegian,
|
'nb' : messagesNorwegian,
|
||||||
'de' : messagesGerman,
|
'de' : messagesGerman,
|
||||||
'hu' : messagesHungarian,
|
'hu' : messagesHungarian,
|
||||||
'pl' : messagesPolish,
|
'pl' : messagesPolish,
|
||||||
'dk' : messagesDanish,
|
'dk' : messagesDanish,
|
||||||
'fr' : messagesFrench,
|
'fr' : messagesFrench,
|
||||||
'el' : messagesGreek,
|
'el' : messagesGreek,
|
||||||
'ro' : messagesRomanian,
|
'ro' : messagesRomanian,
|
||||||
'pt' : messagesPortuguese,
|
'pt' : messagesPortuguese,
|
||||||
'zh-hans' : messagesChineseSimplified,
|
'zh-hans' : messagesChineseSimplified,
|
||||||
'zh-hant' : messagesChineseTraditional,
|
'zh-hant' : messagesChineseTraditional,
|
||||||
'es' : messagesSpanish,
|
'es' : messagesSpanish,
|
||||||
'hr' : messagesCroatian,
|
'hr' : messagesCroatian,
|
||||||
'cs' : messagesCzech,
|
'cs' : messagesCzech,
|
||||||
'it' : messagesItalian,
|
'it' : messagesItalian,
|
||||||
'uk' : messagesUkrainian,
|
'uk' : messagesUkrainian,
|
||||||
'tr' : messagesTurkish,
|
'tr' : messagesTurkish,
|
||||||
'lv' : messagesLatvian
|
'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
|
let locale = browserLanguage.split(/[-_]/)[0]; // language without region code
|
||||||
|
|
||||||
if (locale === 'zh')
|
if (locale === 'zh')
|
||||||
{
|
{
|
||||||
if (browserLanguage === 'zh-cn')
|
if (browserLanguage === 'zh-cn')
|
||||||
locale = 'zh-hans'
|
locale = 'zh-hans';
|
||||||
else
|
else
|
||||||
locale = 'zh-hant'
|
locale = 'zh-hant';
|
||||||
}
|
}
|
||||||
|
|
||||||
const intl = createIntl({
|
const intl = createIntl({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue