Skip to content

Commit cec438e

Browse files
committed
Fix #38
1 parent 94ad8be commit cec438e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

app/components/Android/Run.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ class RunAndroid extends PureComponent<$RunAndroidProps, $RunAndroidState> {
9898
const cmd = 'react-native run-android';
9999
const options = [];
100100
for (const option in this.state.options) {
101-
options.push(`--${option} "${this.state.options[option]}"`);
101+
if (typeof this.state.options[option] === 'boolean') {
102+
options.push(`--${option}`);
103+
} else {
104+
options.push(`--${option} "${this.state.options[option]}"`);
105+
}
102106
}
103107
return `${cmd} ${options.join(' ')}`;
104108
};

app/components/Android/RunOptions.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,19 @@ class AndroidRunOptions extends PureComponent<$AndroidRunOptionsProps, $AndroidR
2525
<div key={key}>
2626
<Toggle
2727
label={option.label || startCase(key)}
28-
toggled={option.default}
2928
labelStyle={{color: '#777'}}
30-
value={this.state.options[key]}
31-
onChange={(event: SyntheticInputEvent<HTMLInputElement>) => {
32-
const {value} = event.target;
29+
toggled={this.state.options[key]}
30+
onToggle={(
31+
event: SyntheticUIEvent<HTMLInputElement>,
32+
isInputChecked: boolean,
33+
) => {
3334
this.setState({
3435
options: {
3536
...this.state.options,
36-
[key]: value,
37+
[key]: isInputChecked,
3738
},
3839
}, () => {
39-
this.props.onChange(key, option, value);
40+
this.props.onChange(key, option, isInputChecked);
4041
});
4142
}}
4243
/>

0 commit comments

Comments
 (0)