Skip to content

Commit

Permalink
"Download updates automatically" toggle enabled only for administrato…
Browse files Browse the repository at this point in the history
…r account (#2357)

* Added condition to disable auto updates toggle in settings for non-administrator accounts
  • Loading branch information
yevhenii44-zz committed Apr 27, 2020
1 parent 8ccc996 commit 55c311c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/settings-web/src/components/GeneralSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class GeneralSettings extends React.Component <any, any> {
});
let result : any = {};
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,
run_elevated: this.elevated_reference != null && this.elevated_reference.get_value().value,
theme: this.theme_reference.get_value().value,
Expand Down Expand Up @@ -125,14 +125,16 @@ export class GeneralSettings extends React.Component <any, any> {
<Separator />
<Text variant='xLarge'>General</Text>

<Stack>
{this.state.settings.general.is_admin &&
(<Stack>
<Label>Download updates automatically</Label>
<BoolToggleSettingsControl
setting={{value: this.state.settings.general.download_updates_automatically}}
disabled={!this.state.settings.general.is_admin}
on_change={this.parent_on_change}
ref={(input) => {this.download_updates_automatically_reference=input;}}
/>
</Stack>
</Stack>)}


<Stack>
Expand Down
2 changes: 1 addition & 1 deletion src/settings/settings-html/dist/bundle.js

Large diffs are not rendered by default.

0 comments on commit 55c311c

Please sign in to comment.