fix error messages

This commit is contained in:
feruz 2020-03-25 09:37:32 +02:00
parent b0589aff8b
commit c751a1aae1
4 changed files with 8 additions and 11 deletions

View File

@ -164,7 +164,7 @@ class PostDropdownContainer extends PureComponent {
),
);
} else {
if (error && error.error_description.split(':')[1].includes('wait to transact')) {
if (error && error.jse_shortmsg.split(':')[1].includes('wait to transact')) {
//when RC is not enough, offer boosting account
Alert.alert(
intl.formatMessage({

View File

@ -104,8 +104,8 @@ class UpvoteView extends Component {
console.log(err);
if (
err &&
err.error_description.split(':')[1] &&
err.error_description.split(':')[1].includes('wait to transact')
err.jse_shortmsg.split(':')[1] &&
err.jse_shortmsg.split(':')[1].includes('wait to transact')
) {
//when RC is not enough, offer boosting account
Alert.alert(
@ -131,19 +131,19 @@ class UpvoteView extends Component {
});
} else {
//when voting with same percent or other errors
if (err.error_description.indexOf(':') > 0) {
if (err.jse_shortmsg.indexOf(':') > 0) {
Alert.alert(
intl.formatMessage({
id: 'alert.fail',
}),
err.error_description.split(':')[1],
err.jse_shortmsg.split(':')[1],
);
} else {
Alert.alert(
intl.formatMessage({
id: 'alert.fail',
}),
err.error_description,
err.jse_shortmsg,
);
}
this.setState({

View File

@ -184,10 +184,7 @@ class ProfileContainer extends Component {
});
console.log(error);
if (error) {
if (
error.error_description &&
error.error_description.split(':')[1].includes('wait to transact')
) {
if (error.jse_shortmsg && error.jse_shortmsg.split(':')[1].includes('wait to transact')) {
//when RC is not enough, offer boosting account
Alert.alert(
intl.formatMessage({

View File

@ -397,7 +397,7 @@ class EditorContainer extends Component {
_handleSubmitFailure = (error) => {
const { intl } = this.props;
console.log(error);
if (error && error.error_description.split(':')[1].includes('wait to transact')) {
if (error && error.jse_shortmsg.split(':')[1].includes('wait to transact')) {
//when RC is not enough, offer boosting account
Alert.alert(
intl.formatMessage({