Remove duplicate display of network errors
Network errors render as a resend dialogue at the top of the message detail and need not be re-reported in the contact list or errors section. // FREEBIE
This commit is contained in:
parent
f221921127
commit
1bd0855d93
1 changed files with 9 additions and 5 deletions
|
@ -12,7 +12,9 @@
|
||||||
this.conflict = options.conflict;
|
this.conflict = options.conflict;
|
||||||
this.errors = _.reject(options.errors, function(e) {
|
this.errors = _.reject(options.errors, function(e) {
|
||||||
return (e.name === 'IncomingIdentityKeyError' ||
|
return (e.name === 'IncomingIdentityKeyError' ||
|
||||||
e.name === 'OutgoingIdentityKeyError');
|
e.name === 'OutgoingIdentityKeyError' ||
|
||||||
|
e.name === 'OutgoingMessageError' ||
|
||||||
|
e.name === 'SendMessageNetworkError');
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -125,15 +127,17 @@
|
||||||
e.name === 'OutgoingMessageError' ||
|
e.name === 'OutgoingMessageError' ||
|
||||||
e.name === 'SendMessageNetworkError');
|
e.name === 'SendMessageNetworkError');
|
||||||
});
|
});
|
||||||
var hasConflict = false;
|
var unknownErrors = this.errors['undefined'];
|
||||||
if (this.model.hasKeyConflicts()) {
|
if (unknownErrors) {
|
||||||
hasConflict = i18n('newIdentity');
|
unknownErrors = unknownErrors.filter(function(e) {
|
||||||
|
return (e.name !== 'MessageError');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.$el.html(Mustache.render(_.result(this, 'template', ''), {
|
this.$el.html(Mustache.render(_.result(this, 'template', ''), {
|
||||||
sent_at : moment(this.model.get('sent_at')).toString(),
|
sent_at : moment(this.model.get('sent_at')).toString(),
|
||||||
received_at : this.model.isIncoming() ? moment(this.model.get('received_at')).toString() : null,
|
received_at : this.model.isIncoming() ? moment(this.model.get('received_at')).toString() : null,
|
||||||
tofrom : this.model.isIncoming() ? i18n('from') : i18n('to'),
|
tofrom : this.model.isIncoming() ? i18n('from') : i18n('to'),
|
||||||
errors : this.errors['undefined'],
|
errors : unknownErrors,
|
||||||
title : i18n('messageDetail'),
|
title : i18n('messageDetail'),
|
||||||
sent : i18n('sent'),
|
sent : i18n('sent'),
|
||||||
received : i18n('received'),
|
received : i18n('received'),
|
||||||
|
|
Loading…
Reference in a new issue