Skip to content

Commit

Permalink
show error on update error instead of continuing on
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Oct 5, 2018
1 parent d8c573c commit a079fb2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions templates/entity-edit-screen.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ class <%= props.name %>EntityEditScreen extends React.Component {
// Did the update attempt complete?
if (!newProps.updating && this.state.requesting) {
if (newProps.error) {
if (newProps.error === 'WRONG') {
Alert.alert('Error', 'Something went wrong updating the entity', [{text: 'OK'}])
}
Alert.alert('Error', 'Something went wrong updating the entity', [{text: 'OK'}])
this.setState({
success: false,
requesting: false
Expand Down Expand Up @@ -141,7 +139,7 @@ const mapStateToProps = (state) => {
<%= camelCase(props.name) %>: state.<%= camelCase(props.pluralName) %>.<%= camelCase(props.name) %>,
fetching: state.<%= camelCase(props.pluralName) %>.fetchingOne,
updating: state.<%= camelCase(props.pluralName) %>.updating,
error: state.<%= camelCase(props.pluralName) %>.errorOne
error: state.<%= camelCase(props.pluralName) %>.errorUpdating
}
}

Expand Down

0 comments on commit a079fb2

Please sign in to comment.