File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,16 @@ export default class ContentType extends React.Component {
2727 }
2828 }
2929
30+ componentWillReceiveProps ( nextProps ) {
31+ if ( ! nextProps . contentTypes || ! nextProps . contentTypes . size ) {
32+ return
33+ }
34+
35+ if ( ! nextProps . contentTypes . includes ( nextProps . value ) ) {
36+ nextProps . onChange ( nextProps . contentTypes . first ( ) )
37+ }
38+ }
39+
3040 onChangeWrapper = e => this . props . onChange ( e . target . value )
3141
3242 render ( ) {
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ const RequestBody = ({
2222
2323 const mediaTypeValue = requestBodyContent . get ( contentType )
2424
25+ if ( ! mediaTypeValue ) {
26+ return null
27+ }
28+
2529 return < div >
2630 { requestBodyDescription &&
2731 < Markdown source = { requestBodyDescription } />
You can’t perform that action at this time.
0 commit comments