Fix "missing ThreadAssociatedData", again.

This commit is contained in:
Matthew Chen 2021-05-25 09:39:23 -03:00
parent 86f8793b39
commit ea7721fd65

View File

@ -51,8 +51,19 @@ class ComposeViewController: OWSViewController {
func newConversation(address: SignalServiceAddress) {
assert(address.isValid)
let thread = TSContactThread.getOrCreateThread(contactAddress: address)
newConversation(thread: thread)
Self.databaseStorage.write { [weak self] transaction in
let thread = TSContactThread.getOrCreateThread(withContactAddress: address,
transaction: transaction)
Self.databaseStorage.touch(thread: thread,
shouldReindex: false,
transaction: transaction)
Self.databaseStorage.add(uiDatabaseSnapshotFlushBlock: {
DispatchQueue.main.async {
self?.newConversation(thread: thread)
}
})
}
}
func newConversation(thread: TSThread) {