diff --git a/embark-ui/src/containers/EditorContainer.js b/embark-ui/src/containers/EditorContainer.js index 2efced53a..5418fd00c 100644 --- a/embark-ui/src/containers/EditorContainer.js +++ b/embark-ui/src/containers/EditorContainer.js @@ -3,6 +3,9 @@ import PropTypes from 'prop-types'; import {connect} from 'react-redux'; import {withRouter} from "react-router-dom"; import {Row, Col} from 'reactstrap'; +import classnames from 'classnames'; +import Resizable from 're-resizable'; + import TextEditorAsideContainer from './TextEditorAsideContainer'; import TextEditorContainer from './TextEditorContainer'; import FileExplorerContainer from './FileExplorerContainer'; @@ -15,9 +18,8 @@ import { } from '../actions'; import {getCurrentFile, getContracts, getTransaction} from '../reducers/selectors'; import {getDebuggerTransactionHash} from '../utils/utils'; -import classnames from 'classnames'; -import Resizable from 're-resizable'; import {OPERATIONS} from '../constants'; +import { TextEditorToolbarTabs } from '../components/TextEditorToolbar'; import './EditorContainer.css'; @@ -69,10 +71,10 @@ class EditorContainer extends React.Component { this.setState({currentFile: this.props.currentFile}); } - if(this.props.contracts && this.props.transaction !== prevProps.transaction) { + if(this.props.contracts && this.props.transaction !== prevProps.transaction && this.props.transaction) { const debuggingContract = this.props.contracts.find(contract => contract.address === this.props.transaction.to) if (debuggingContract) { - this.setState({currentAsideTab: 'debugger'}) + this.setState({currentAsideTab: TextEditorToolbarTabs.Debugger}) this.props.fetchFile({path: debuggingContract.path}); } } diff --git a/embark-ui/src/containers/TextEditorAsideContainer.js b/embark-ui/src/containers/TextEditorAsideContainer.js index ac34f6eb3..6bfdafc84 100644 --- a/embark-ui/src/containers/TextEditorAsideContainer.js +++ b/embark-ui/src/containers/TextEditorAsideContainer.js @@ -13,7 +13,7 @@ import { TextEditorToolbarTabs } from '../components/TextEditorToolbar'; class TextEditorAsideContainer extends Component { renderContent(contract, index) { - switch (this.props.currentAsideTab) { + switch (this.props.currentAsideTab.label) { case TextEditorToolbarTabs.Details.label: return ( @@ -71,7 +71,7 @@ function mapStateToProps(state, props) { TextEditorAsideContainer.propTypes = { currentFile: PropTypes.object, debuggerTransactionHash: PropTypes.string, - currentAsideTab: PropTypes.string, + currentAsideTab: PropTypes.object, contracts: PropTypes.array };