From a079fb2a7002e1614336420e676ef239e9c47d3c Mon Sep 17 00:00:00 2001 From: Jonathan Ruddell Date: Thu, 4 Oct 2018 18:05:33 -0700 Subject: [PATCH] show error on update error instead of continuing on --- templates/entity-edit-screen.ejs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/entity-edit-screen.ejs b/templates/entity-edit-screen.ejs index 815d7f9f6..5601502c9 100644 --- a/templates/entity-edit-screen.ejs +++ b/templates/entity-edit-screen.ejs @@ -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 @@ -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 } }