mirror of https://github.com/embarklabs/embark.git
fix(@cockpit/debugger): check if `debuggingContract` is undefined
Guard against redux-saga fetching races in `componentDidUpdate`.
This commit is contained in:
parent
3f77272e71
commit
3590197c55
|
@ -81,7 +81,7 @@ class EditorContainer extends React.Component {
|
||||||
|
|
||||||
if(this.props.contracts.length && this.props.transaction) {
|
if(this.props.contracts.length && this.props.transaction) {
|
||||||
const debuggingContract = this.props.contracts.find(contract => contract.address === this.props.transaction.to)
|
const debuggingContract = this.props.contracts.find(contract => contract.address === this.props.transaction.to)
|
||||||
if (this.state.debuggingContract !== debuggingContract) {
|
if (debuggingContract && this.state.debuggingContract !== debuggingContract) {
|
||||||
const editorWidth = this.getNewEditorWidth(OPERATIONS.LESS)
|
const editorWidth = this.getNewEditorWidth(OPERATIONS.LESS)
|
||||||
this.setState({currentAsideTab: TextEditorToolbarTabs.Debugger, editorWidth, debuggingContract})
|
this.setState({currentAsideTab: TextEditorToolbarTabs.Debugger, editorWidth, debuggingContract})
|
||||||
this.props.fetchFile({path: debuggingContract.path});
|
this.props.fetchFile({path: debuggingContract.path});
|
||||||
|
|
Loading…
Reference in New Issue