MessageView: Add id from database to DOM for outgoing messages (#2350)
This commit is contained in:
parent
b41cf47df6
commit
b6a585a646
1 changed files with 8 additions and 0 deletions
|
@ -313,6 +313,7 @@
|
||||||
onChange() {
|
onChange() {
|
||||||
this.renderSent();
|
this.renderSent();
|
||||||
this.renderQuote();
|
this.renderQuote();
|
||||||
|
this.addId();
|
||||||
},
|
},
|
||||||
select(e) {
|
select(e) {
|
||||||
this.$el.trigger('select', { message: this.model });
|
this.$el.trigger('select', { message: this.model });
|
||||||
|
@ -470,6 +471,13 @@
|
||||||
|
|
||||||
return body || isGroupUpdate || isEndSession || errorsCanBeContents;
|
return body || isGroupUpdate || isEndSession || errorsCanBeContents;
|
||||||
},
|
},
|
||||||
|
addId() {
|
||||||
|
// Because we initially render a sent Message before we've roundtripped with the
|
||||||
|
// database, we don't have its id for that first render. We do get a change event,
|
||||||
|
// however, and can add the id manually.
|
||||||
|
const { id } = this.model;
|
||||||
|
this.$el.attr('id', id);
|
||||||
|
},
|
||||||
render() {
|
render() {
|
||||||
const contact = this.model.isIncoming() ? this.model.getContact() : null;
|
const contact = this.model.isIncoming() ? this.model.getContact() : null;
|
||||||
const attachments = this.model.get('attachments');
|
const attachments = this.model.get('attachments');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue