Update comment

pull/374/head
Niels Andriesse
parent 484f7f04b0
commit e26f6e946b

@ -232,13 +232,13 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
let tsMessage = TSOutgoingMessage.from(message, associatedWith: thread) let tsMessage = TSOutgoingMessage.from(message, associatedWith: thread)
Storage.write(with: { transaction in Storage.write(with: { transaction in
tsMessage.save(with: transaction) tsMessage.save(with: transaction)
// The new cell will be inserted here, but the TSOutgoingMessage now has no attachment. // The new message cell is inserted at this point, but the TSOutgoingMessage doesn't have its attachment yet
}, completion: { [weak self] in }, completion: { [weak self] in
Storage.write(with: { transaction in Storage.write(with: { transaction in
MessageSender.send(message, with: attachments, in: thread, using: transaction) MessageSender.send(message, with: attachments, in: thread, using: transaction)
}, completion: { [weak self] in }, completion: { [weak self] in
// The TSOutgoingMessage has no attachment IDs until the `prep` finished. // At this point the TSOutgoingMessage should have its attachments set, so we can scroll to the bottom knowing
// Scroll to bottom here so the tableview can calculate the cell's height with the attachments correctly. // the height of the new message cell
self?.scrollToBottom(isAnimated: false) self?.scrollToBottom(isAnimated: false)
}) })
self?.handleMessageSent() self?.handleMessageSent()

Loading…
Cancel
Save