From df140584e7c0ed05079946d28bb0772e44df63e0 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 7 Sep 2022 16:40:14 +1000 Subject: [PATCH] feat: add tapping function for contacts in new conversation screen --- Session/Home/New Conversation/NewConversationVC.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Session/Home/New Conversation/NewConversationVC.swift b/Session/Home/New Conversation/NewConversationVC.swift index 4ba08e519..a3e6f8b80 100644 --- a/Session/Home/New Conversation/NewConversationVC.swift +++ b/Session/Home/New Conversation/NewConversationVC.swift @@ -140,6 +140,16 @@ final class NewConversationVC: BaseVC, UITableViewDelegate, UITableViewDataSourc func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) + let sessionId = newConversationViewModel.sectionData[indexPath.section].contacts[indexPath.row].id + let maybeThread: SessionThread? = Storage.shared.write { db in + try SessionThread.fetchOrCreate(db, id: sessionId, variant: .contact) + } + + guard maybeThread != nil else { return } + + self.navigationController?.dismiss(animated: true, completion: nil) + + SessionApp.presentConversation(for: sessionId, action: .compose, animated: false) } // MARK: - Interaction