This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix newError noops when not bound to dispacher #4013
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bc386e9
AddContract properly binds newError
jacogr fe22775
EditMeta properly binds newError
jacogr ee1950e
PasswordManager properly binds newError
jacogr f0cc5a3
pass null instead of empty mapStateToProps
jacogr 5c460ed
Add openSnackbar test & binded prop
jacogr df5bd21
Merge branch 'master' into jg-newError-bindings
jacogr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,20 +17,24 @@ | |
import { observer } from 'mobx-react'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { connect } from 'react-redux'; | ||
import { bindActionCreators } from 'redux'; | ||
|
||
import { newError } from '~/redux/actions'; | ||
import { Button, Form, Input, InputChip, Modal } from '~/ui'; | ||
import { CancelIcon, SaveIcon } from '~/ui/Icons'; | ||
|
||
import Store from './store'; | ||
|
||
@observer | ||
export default class EditMeta extends Component { | ||
class EditMeta extends Component { | ||
static contextTypes = { | ||
api: PropTypes.object.isRequired | ||
} | ||
|
||
static propTypes = { | ||
account: PropTypes.object.isRequired, | ||
newError: PropTypes.func.isRequired, | ||
onClose: PropTypes.func.isRequired | ||
} | ||
|
||
|
@@ -138,6 +142,20 @@ export default class EditMeta extends Component { | |
|
||
return this.store | ||
.save() | ||
.then(() => this.props.onClose()); | ||
.then(() => this.props.onClose()) | ||
.catch((error) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
this.props.newError(error); | ||
}); | ||
} | ||
} | ||
|
||
function mapDispatchToProps (dispatch) { | ||
return bindActionCreators({ | ||
newError | ||
}, dispatch); | ||
} | ||
|
||
export default connect( | ||
null, | ||
mapDispatchToProps | ||
)(EditMeta); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case it's not worth it yet, but once we have more stubs, restoring them can easily be forgotten (which breaks the whole point of the stubs then). sandboxes try to address this issue.