mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
"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:
committed by
GitHub
parent
8ccc996e63
commit
55c311cd39
@@ -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>
|
||||||
|
|||||||
2
src/settings/settings-html/dist/bundle.js
vendored
2
src/settings/settings-html/dist/bundle.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user