Fix: Ensure that attachments are always rendered
Because we only attach AttachmentViews to the DOM when they fire their 'update' event, we were subject to a race condition. If that event fired after the final Message.render(), then it would be properly attached to the final DOM node. If it fired early, it would end up missing from the visible DOM entirely, attached to the old, discarded version of the message. This change updates our handling of a second call to loadAttachments(). Instead of bailing out if we've been called before, we attempt to re-add our child AttachmentViews to the current DOM. But only if the 'update' event has been fired, and if their current parent node is not what is in the DOM. FREEBIEpull/749/head
parent
da8d49b5ed
commit
f38d8eb4ae
Loading…
Reference in New Issue