operationScheme -> currentScheme
This commit is contained in:
@@ -70,7 +70,7 @@ export default class BaseLayout extends React.Component {
|
||||
<Col className="schemes wrapper" mobile={12}>
|
||||
{ schemes && schemes.size ? (
|
||||
<Schemes
|
||||
operationScheme={specSelectors.operationScheme()}
|
||||
currentScheme={specSelectors.operationScheme()}
|
||||
schemes={ schemes }
|
||||
specActions={ specActions } />
|
||||
) : null }
|
||||
|
||||
@@ -229,7 +229,7 @@ export default class Operation extends PureComponent {
|
||||
path={ path }
|
||||
method={ method }
|
||||
specActions={ specActions }
|
||||
operationScheme={ operationScheme } />
|
||||
currentScheme={ operationScheme } />
|
||||
</div> : null
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export default class Schemes extends React.Component {
|
||||
static propTypes = {
|
||||
specActions: PropTypes.object.isRequired,
|
||||
schemes: PropTypes.object.isRequired,
|
||||
operationScheme: PropTypes.string.isRequired,
|
||||
currentScheme: PropTypes.string.isRequired,
|
||||
path: PropTypes.string,
|
||||
method: PropTypes.string,
|
||||
}
|
||||
@@ -19,8 +19,8 @@ export default class Schemes extends React.Component {
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if ( !this.props.operationScheme || !nextProps.schemes.includes(this.props.operationScheme) ) {
|
||||
// if we don't have a selected operationScheme or if our selected scheme is no longer an option,
|
||||
if ( !this.props.currentScheme || !nextProps.schemes.includes(this.props.currentScheme) ) {
|
||||
// if we don't have a selected currentScheme or if our selected scheme is no longer an option,
|
||||
// then fire 'change' event and select the first scheme in the list of options
|
||||
this.setScheme(nextProps.schemes.first())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user