Render messages light blue until finished sending // Fixes #219
This commit is contained in:
parent
405e67c758
commit
3e39271220
5 changed files with 21 additions and 3 deletions
|
@ -75,7 +75,8 @@
|
||||||
type : 'outgoing',
|
type : 'outgoing',
|
||||||
attachments : attachments,
|
attachments : attachments,
|
||||||
sent_at : now,
|
sent_at : now,
|
||||||
received_at : now
|
received_at : now,
|
||||||
|
pending : true
|
||||||
});
|
});
|
||||||
message.save();
|
message.save();
|
||||||
|
|
||||||
|
@ -95,7 +96,10 @@
|
||||||
else {
|
else {
|
||||||
sendFunc = textsecure.messaging.sendMessageToGroup;
|
sendFunc = textsecure.messaging.sendMessageToGroup;
|
||||||
}
|
}
|
||||||
sendFunc(this.get('id'), body, attachments, now).catch(function(errors) {
|
sendFunc(this.get('id'), body, attachments, now).then(function() {
|
||||||
|
message.unset('pending');
|
||||||
|
message.save();
|
||||||
|
}.bind(this)).catch(function(errors) {
|
||||||
var keyErrors = [];
|
var keyErrors = [];
|
||||||
_.each(errors, function(e) {
|
_.each(errors, function(e) {
|
||||||
if (e.error.name === 'OutgoingIdentityKeyError') {
|
if (e.error.name === 'OutgoingIdentityKeyError') {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.listenTo(this.model, 'change:body change:errors', this.render);
|
this.listenTo(this.model, 'change:body change:errors', this.render);
|
||||||
this.listenTo(this.model, 'change:delivered', this.renderDelivered);
|
this.listenTo(this.model, 'change:delivered', this.renderDelivered);
|
||||||
|
this.listenTo(this.model, 'change', this.renderPending);
|
||||||
this.listenTo(this.model, 'change:flags change:group_update', this.renderControl);
|
this.listenTo(this.model, 'change:flags change:group_update', this.renderControl);
|
||||||
this.listenTo(this.model, 'destroy', this.remove);
|
this.listenTo(this.model, 'destroy', this.remove);
|
||||||
},
|
},
|
||||||
|
@ -35,6 +36,11 @@
|
||||||
className: function() {
|
className: function() {
|
||||||
return ["entry", this.model.get('type')].join(' ');
|
return ["entry", this.model.get('type')].join(' ');
|
||||||
},
|
},
|
||||||
|
renderPending: function() {
|
||||||
|
if (this.model.isOutgoing()) {
|
||||||
|
this.$el.toggleClass('pending', !!this.model.get('pending'));
|
||||||
|
}
|
||||||
|
},
|
||||||
renderDelivered: function() {
|
renderDelivered: function() {
|
||||||
if (this.model.get('delivered')) { this.$el.addClass('delivered'); }
|
if (this.model.get('delivered')) { this.$el.addClass('delivered'); }
|
||||||
},
|
},
|
||||||
|
@ -66,6 +72,7 @@
|
||||||
content.html(this.autoLink(content.html()));
|
content.html(this.autoLink(content.html()));
|
||||||
|
|
||||||
this.renderDelivered();
|
this.renderDelivered();
|
||||||
|
this.renderPending();
|
||||||
this.renderControl();
|
this.renderControl();
|
||||||
|
|
||||||
this.$('.attachments').append(
|
this.$('.attachments').append(
|
||||||
|
|
|
@ -182,6 +182,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.outgoing.pending .bubble {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
.incoming {
|
.incoming {
|
||||||
.bubble {
|
.bubble {
|
||||||
color: $grey_d;
|
color: $grey_d;
|
||||||
|
|
|
@ -500,6 +500,9 @@ input.search {
|
||||||
.message-detail .bubble p,
|
.message-detail .bubble p,
|
||||||
.message-list .bubble p {
|
.message-list .bubble p {
|
||||||
margin: 0; }
|
margin: 0; }
|
||||||
|
.message-detail .outgoing.pending .bubble,
|
||||||
|
.message-list .outgoing.pending .bubble {
|
||||||
|
opacity: 0.7; }
|
||||||
.message-detail .incoming .bubble,
|
.message-detail .incoming .bubble,
|
||||||
.message-list .incoming .bubble {
|
.message-list .incoming .bubble {
|
||||||
color: #454545;
|
color: #454545;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue