More work on replayable errors
Expose a button that does that retries outgoing messages if possible. // FREEBIE
This commit is contained in:
parent
bc0c9bd133
commit
a32f3ff1f6
8 changed files with 131 additions and 55 deletions
|
@ -175,8 +175,18 @@
|
|||
this.set({errors: errors});
|
||||
},
|
||||
|
||||
removeOutgoingErrors: function(number) {
|
||||
var errors = _.partition(this.get('errors'), function(e) {
|
||||
return e.number === number &&
|
||||
(e.name === 'OutgoingMessageError' ||
|
||||
e.name === 'SendMessageNetworkError');
|
||||
});
|
||||
this.set({errors: errors[1]});
|
||||
return errors[0][0];
|
||||
},
|
||||
|
||||
resend: function(number) {
|
||||
var error = this.getSendError(number);
|
||||
var error = this.removeOutgoingErrors(number);
|
||||
if (error) {
|
||||
var promise = new textsecure.ReplayableError(error).replay();
|
||||
this.send(promise);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue