Fix global state issues with Schemes component

This commit is contained in:
Kyle Shockey
2017-08-09 17:06:48 -07:00
parent be293de220
commit 9dee2daa14
3 changed files with 38 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ export default class Schemes extends React.Component {
}
componentWillReceiveProps(nextProps) {
if ( !this.props.operationScheme || !nextProps.schemes.has(this.props.operationScheme) ) {
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,
// then fire 'change' event and select the first scheme in the list of options
this.setScheme(nextProps.schemes.first())