Cleanup settings-web (#280)

This commit is contained in:
Alaric von Teplitz
2019-09-09 04:47:18 -07:00
committed by Bartosz Sosnowski
parent 5f5402aa0a
commit ffa1b1e6a3
10 changed files with 35 additions and 64 deletions

View File

@@ -1,25 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script>
window.output_from_webview = function(arg) {
if (typeof (window.external) !== 'undefined' && ('notify' in window.external)) {
window.external.notify(arg);
}
}
function receive_from_settings_app(arg) {
window.react_app_component.receive_config_msg(JSON.parse(arg));
return "";
}
function exit_settings_app() {
window.react_app_component.receive_exit_request();
return "";
}
</script>
<title>PowerToys Settings</title>
</head>
<body>
<div id="app"></div>
<script src="dist/bundle.js" charset="UTF-8"></script>
</body>
</html>

View File

@@ -9,11 +9,11 @@
}
function receive_from_settings_app(arg) {
window.react_app_component.receive_config_msg(JSON.parse(arg));
return "";
return '';
}
function exit_settings_app() {
window.react_app_component.receive_exit_request();
return "";
return '';
}
</script>
<title>PowerToys Settings</title>

View File

@@ -10,4 +10,3 @@ export class BaseSettingsControl extends React.Component <any, any> {
return null;
}
}

View File

@@ -17,7 +17,6 @@ export class BoolToggleSettingsControl extends BaseSettingsControl {
this.setState({ property_values: props.setting })
}
public get_value() : any {
return {value: this.toggleref.checked};
}
@@ -45,5 +44,4 @@ export class BoolToggleSettingsControl extends BaseSettingsControl {
/>
);
}
}

View File

@@ -41,5 +41,4 @@ export class ColorPickerSettingsControl extends BaseSettingsControl {
</Stack>
);
}
}

View File

@@ -19,12 +19,13 @@ export class CustomSettingsScreen extends React.Component <any, any> {
powertoy: props.powertoy,
}
}
shouldComponentUpdate(nextProps:any, nextState:any)
{
shouldComponentUpdate(nextProps:any, nextState:any) {
// This component and its children manage their state.
// React only to state changes when forceUpdate is called by the App component.
return false;
}
componentWillReceiveProps(props: any) {
this.setState({ powertoy: props.powertoy })
}

View File

@@ -17,12 +17,13 @@ export class GeneralSettings extends React.Component <any, any> {
settings: props.settings,
}
}
shouldComponentUpdate(nextProps:any, nextState:any)
{
shouldComponentUpdate(nextProps:any, nextState:any) {
// This component and its children manage their state.
// React only to state changes when forceUpdate is called by the App component.
return false;
}
componentWillReceiveProps(props: any) {
this.setState({ settings: props.settings })
}

View File

@@ -95,5 +95,4 @@ export class IntSpinnerSettingsControl extends BaseSettingsControl {
/>
);
}
}

View File

@@ -26,4 +26,3 @@ if (root && root.hasChildNodes()) {
/>,
root);
}