Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Commit 61b0b41

Browse files
committed
Update preset description when props received
1 parent f293719 commit 61b0b41

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/components/PresetSelection.jsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,34 @@ export default class PresetSelection extends React.Component {
1313
this.description = "";
1414

1515
this.handlePresetSelectClick = this.handlePresetSelectClick.bind(this);
16+
this.updatePresetDescription = this.updatePresetDescription.bind(this);
1617
}
1718

1819
handlePresetSelectClick = (event, value) => {
1920
this.setState({ presetSelected: value });
2021

22+
this.updatePresetDescription();
23+
24+
if(this.props.onChanged !== null) {
25+
this.props.onChange(value);
26+
}
27+
};
28+
29+
updatePresetDescription() {
2130
if(value === "podman") {
2231
this.description = this.props.podmanDescription;
2332
}
2433
if(value === "openshift") {
2534
this.description = this.props.openshiftDescription;
2635
}
27-
28-
if(this.props.onChanged !== null) {
29-
this.props.onChange(value);
30-
}
31-
};
36+
}
3237

3338
componentWillReceiveProps(nextProps) {
3439
this.setState({
3540
presetSelected: nextProps.value
3641
})
3742

38-
// handlePresetSelectClick()
43+
this.updatePresetDescription();
3944
}
4045

4146
render() {

0 commit comments

Comments
 (0)