@@ -35,12 +35,12 @@ extension ConversationVC:
3535 }
3636
3737 // Handle taps outside of tableview cell to dismiss keyboard
38- @MainActor @objc func dismissKeyboardOnTap ( _ recognizer: UITapGestureRecognizer ) {
39- /// If the tap was inside the "Send" button on the input then we **don't** want to dismiss the keyboard (the user should be
40- /// able to send multiple messages in a row )
41- let location : CGPoint = recognizer. location ( in: self . snInputView. sendButton )
38+ @MainActor @objc func dismissKeyboardOnMessageListTap ( _ recognizer: UITapGestureRecognizer ) {
39+ /// If the tap was inside the input then we **don't** want to dismiss the keyboard (the user should be able to interact with their
40+ /// current text, or tap the buttons without the keyboard being dismissed )
41+ let location : CGPoint = recognizer. location ( in: self . snInputView)
4242
43- guard !snInputView. sendButton . bounds. contains ( location) else { return }
43+ guard !snInputView. bounds. contains ( location) else { return }
4444
4545 _ = self . snInputView. resignFirstResponder ( )
4646 }
@@ -1642,41 +1642,43 @@ extension ConversationVC:
16421642 return cellViewModel. profile? . blocksCommunityMessageRequests != true
16431643 } ( )
16441644
1645- let userProfileModal : ModalHostingViewController = ModalHostingViewController (
1646- modal: UserProfileModal (
1647- info: . init(
1648- sessionId: sessionId,
1649- blindedId: blindedId,
1650- qrCodeImage: qrCodeImage,
1651- profileInfo: profileInfo,
1652- displayName: displayName,
1653- contactDisplayName: contactDisplayName,
1654- isProUser: dependencies. mutate ( cache: . libSession, { $0. validateProProof ( for: cellViewModel. profile) } ) ,
1655- isMessageRequestsEnabled: isMessasgeRequestsEnabled,
1656- onStartThread: { [ weak self] in
1657- self ? . startThread (
1658- with: cellViewModel. authorId,
1659- openGroupServer: cellViewModel. threadOpenGroupServer,
1660- openGroupPublicKey: cellViewModel. threadOpenGroupPublicKey
1661- )
1662- } ,
1663- onProBadgeTapped: { [ weak self, dependencies] in
1664- dependencies [ singleton: . sessionProState] . showSessionProCTAIfNeeded (
1665- . generic,
1666- dismissType: . single,
1667- afterClosed: { [ weak self] in
1668- self ? . snInputView. updateNumberOfCharactersLeft ( self ? . snInputView. text ?? " " )
1669- } ,
1670- presenting: { modal in
1671- dependencies [ singleton: . appContext] . frontMostViewController? . present ( modal, animated: true )
1672- }
1673- )
1674- }
1675- ) ,
1676- dataManager: dependencies [ singleton: . imageDataManager]
1645+ DispatchQueue . main. async { [ weak self] in
1646+ let userProfileModal : ModalHostingViewController = ModalHostingViewController (
1647+ modal: UserProfileModal (
1648+ info: . init(
1649+ sessionId: sessionId,
1650+ blindedId: blindedId,
1651+ qrCodeImage: qrCodeImage,
1652+ profileInfo: profileInfo,
1653+ displayName: displayName,
1654+ contactDisplayName: contactDisplayName,
1655+ isProUser: dependencies. mutate ( cache: . libSession, { $0. validateProProof ( for: cellViewModel. profile) } ) ,
1656+ isMessageRequestsEnabled: isMessasgeRequestsEnabled,
1657+ onStartThread: { [ weak self] in
1658+ self ? . startThread (
1659+ with: cellViewModel. authorId,
1660+ openGroupServer: cellViewModel. threadOpenGroupServer,
1661+ openGroupPublicKey: cellViewModel. threadOpenGroupPublicKey
1662+ )
1663+ } ,
1664+ onProBadgeTapped: { [ weak self, dependencies] in
1665+ dependencies [ singleton: . sessionProState] . showSessionProCTAIfNeeded (
1666+ . generic,
1667+ dismissType: . single,
1668+ afterClosed: { [ weak self] in
1669+ self ? . snInputView. updateNumberOfCharactersLeft ( self ? . snInputView. text ?? " " )
1670+ } ,
1671+ presenting: { modal in
1672+ dependencies [ singleton: . appContext] . frontMostViewController? . present ( modal, animated: true )
1673+ }
1674+ )
1675+ }
1676+ ) ,
1677+ dataManager: dependencies [ singleton: . imageDataManager]
1678+ )
16771679 )
1678- )
1679- present ( userProfileModal , animated : true , completion : nil )
1680+ self ? . present ( userProfileModal , animated : true , completion : nil )
1681+ }
16801682 }
16811683
16821684 func startThread(
0 commit comments