Make it clear in conversation just some recipients failed
FREEBIE
This commit is contained in:
parent
c10e1b4ad0
commit
ff4fde651c
6 changed files with 57 additions and 5 deletions
|
@ -249,6 +249,25 @@
|
|||
}.bind(this));
|
||||
},
|
||||
|
||||
someRecipientsFailed: function() {
|
||||
var c = this.getConversation();
|
||||
if (c.isPrivate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var recipients = c.contactCollection.length - 1;
|
||||
var errors = this.get('errors');
|
||||
if (!errors) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (errors.length > 0 && recipients > 0 && errors.length < recipients) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
sendSyncMessage: function() {
|
||||
this.syncPromise = this.syncPromise || Promise.resolve();
|
||||
this.syncPromise = this.syncPromise.then(function() {
|
||||
|
|
|
@ -25,6 +25,14 @@
|
|||
resend: i18n('resend')
|
||||
}
|
||||
});
|
||||
var SomeFailedView = Whisper.View.extend({
|
||||
tagName: 'span',
|
||||
className: 'some-failed',
|
||||
templateName: 'some-failed',
|
||||
render_attributes: {
|
||||
someFailed: i18n('someRecipientsFailed')
|
||||
}
|
||||
});
|
||||
var TimerView = Whisper.View.extend({
|
||||
templateName: 'hourglass',
|
||||
update: function() {
|
||||
|
@ -172,6 +180,7 @@
|
|||
'click .error-icon': 'select',
|
||||
'click .timestamp': 'select',
|
||||
'click .status': 'select',
|
||||
'click .some-failed': 'select',
|
||||
'click .error-message': 'select'
|
||||
},
|
||||
retryMessage: function() {
|
||||
|
@ -241,6 +250,10 @@
|
|||
if (this.model.hasNetworkError()) {
|
||||
this.$('.meta').prepend(new NetworkErrorView().render().el);
|
||||
}
|
||||
this.$('.meta .some-failed').remove();
|
||||
if (this.model.someRecipientsFailed()) {
|
||||
this.$('.meta').prepend(new SomeFailedView().render().el);
|
||||
}
|
||||
},
|
||||
renderControl: function() {
|
||||
if (this.model.isEndSession() || this.model.isGroupUpdate()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue