Make lastN configurable, max, and lock. Fixes #225

auto_join_3.3
Håvar Aambø Fosstveit 2020-04-30 12:32:43 +02:00
parent 174a03814f
commit a64830a06a
2 changed files with 43 additions and 33 deletions

View File

@ -25,6 +25,7 @@ var config =
{ scaleResolutionDownBy: 2 },
{ scaleResolutionDownBy: 1 }
],
/**
* White listing browsers that support audio output device selection.
* It is not yet fully implemented in Firefox.
@ -43,6 +44,10 @@ var config =
},
lastN : 4,
mobileLastN : 1,
// Highest number of speakers user can select
maxLastN : 5,
// If truthy, users can NOT change number of speakers visible
lockLastN : false,
background : 'images/background.jpg',
// Add file and uncomment for adding logo to appbar
// logo : 'images/logo.svg',

View File

@ -355,6 +355,7 @@ const Settings = ({
/>
{ settings.advancedMode &&
<React.Fragment>
{ window.config && !window.config.lockLastN &&
<form className={classes.setting} autoComplete='off'>
<FormControl className={classes.formControl}>
<Select
@ -368,7 +369,10 @@ const Settings = ({
autoWidth
className={classes.selectEmpty}
>
{ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ].map((lastN) =>
{ Array.from(
{ length: window.config.maxLastN || 10 },
(_, i) => i + 1
).map((lastN) =>
{
return (
<MenuItem key={lastN} value={lastN}>
@ -385,6 +389,7 @@ const Settings = ({
</FormHelperText>
</FormControl>
</form>
}
<FormControlLabel
className={classes.setting}
control={<Checkbox checked={settings.permanentTopBar} onChange={onTogglePermanentTopBar} value='permanentTopBar' />}