"Download updates automatically" toggle enabled only for administrator account (#2357)

* Added condition to disable auto updates toggle in settings for non-administrator accounts
This commit is contained in:
Yevhenii Holovachov
2020-04-27 11:04:20 +03:00
committed by GitHub
parent 8ccc996e63
commit 55c311cd39
2 changed files with 6 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ export class GeneralSettings extends React.Component <any, any> {
}); });
let result : any = {}; let result : any = {};
result[this.state.settings_key]= { result[this.state.settings_key]= {
download_updates_automatically: this.download_updates_automatically_reference.get_value().value, download_updates_automatically: this.download_updates_automatically_reference != null && this.download_updates_automatically_reference.get_value().value,
startup: this.startup_reference.get_value().value, startup: this.startup_reference.get_value().value,
run_elevated: this.elevated_reference != null && this.elevated_reference.get_value().value, run_elevated: this.elevated_reference != null && this.elevated_reference.get_value().value,
theme: this.theme_reference.get_value().value, theme: this.theme_reference.get_value().value,
@@ -125,14 +125,16 @@ export class GeneralSettings extends React.Component <any, any> {
<Separator /> <Separator />
<Text variant='xLarge'>General</Text> <Text variant='xLarge'>General</Text>
<Stack> {this.state.settings.general.is_admin &&
(<Stack>
<Label>Download updates automatically</Label> <Label>Download updates automatically</Label>
<BoolToggleSettingsControl <BoolToggleSettingsControl
setting={{value: this.state.settings.general.download_updates_automatically}} setting={{value: this.state.settings.general.download_updates_automatically}}
disabled={!this.state.settings.general.is_admin}
on_change={this.parent_on_change} on_change={this.parent_on_change}
ref={(input) => {this.download_updates_automatically_reference=input;}} ref={(input) => {this.download_updates_automatically_reference=input;}}
/> />
</Stack> </Stack>)}
<Stack> <Stack>

File diff suppressed because one or more lines are too long