MessageView: Add id from database to DOM for outgoing messages (#2350)

pull/1/head
Scott Nonnenberg 8 years ago committed by GitHub
parent b41cf47df6
commit b6a585a646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -313,6 +313,7 @@
onChange() {
this.renderSent();
this.renderQuote();
this.addId();
},
select(e) {
this.$el.trigger('select', { message: this.model });
@ -470,6 +471,13 @@
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() {
const contact = this.model.isIncoming() ? this.model.getContact() : null;
const attachments = this.model.get('attachments');

Loading…
Cancel
Save