fix link preview scrolling issue

pull/375/head
Ryan ZHAO 4 years ago
parent b619a8cb99
commit 3030723bb3

@ -208,9 +208,13 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
message.linkPreview = VisibleMessage.LinkPreview.from(linkPreviewDraft, using: transaction)
}, completion: { [weak self] in
tsMessage.linkPreview = OWSLinkPreview.from(message.linkPreview)
Storage.shared.write { transaction in
Storage.shared.write(with: { transaction in
tsMessage.save(with: transaction as! YapDatabaseReadWriteTransaction)
}
}, completion: { [weak self] in
// At this point the TSOutgoingMessage should have its link preview set, so we can scroll to the bottom knowing
// the height of the new message cell
self?.scrollToBottom(isAnimated: false)
})
Storage.shared.write { transaction in
MessageSender.send(message, with: [], in: thread, using: transaction as! YapDatabaseReadWriteTransaction)
}

Loading…
Cancel
Save