From 3256876eab8c5f73341df168cf7a96addc5c56c3 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 17 Feb 2025 17:13:05 +1100 Subject: [PATCH] update missed call tip modal --- .../Views & Modals/CallMissedTipsModal.swift | 19 ++++++++++++++++--- .../ConversationVC+Interaction.swift | 7 ++++--- Session/Meta/AppDelegate.swift | 3 ++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Session/Calls/Views & Modals/CallMissedTipsModal.swift b/Session/Calls/Views & Modals/CallMissedTipsModal.swift index 3a2df54bf..e08bf645f 100644 --- a/Session/Calls/Views & Modals/CallMissedTipsModal.swift +++ b/Session/Calls/Views & Modals/CallMissedTipsModal.swift @@ -72,10 +72,23 @@ final class CallMissedTipsModal: Modal { // MARK: - Lifecycle - init(caller: String) { + init(caller: String, presentingViewController: UIViewController?) { self.caller = caller - super.init() + super.init( + afterClosed: { + let navController: UINavigationController = StyledNavigationController( + rootViewController: SessionTableViewController( + viewModel: PrivacySettingsViewModel( + shouldShowCloseButton: true, + shouldAutomaticallyShowCallModal: true + ) + ) + ) + navController.modalPresentationStyle = .fullScreen + presentingViewController?.present(navController, animated: true, completion: nil) + } + ) self.modalPresentationStyle = .overFullScreen self.modalTransitionStyle = .crossDissolve @@ -86,7 +99,7 @@ final class CallMissedTipsModal: Modal { } override func populateContentView() { - cancelButton.setTitle("okay".localized(), for: .normal) + cancelButton.setTitle("sessionSettings".localized(), for: .normal) contentView.addSubview(mainStackView) tipsIconContainerView.addSubview(tipsIconImageView) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index ca6fc9df7..6608bbc5f 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -948,12 +948,13 @@ extension ConversationVC: ), messageInfo.state == .permissionDeniedMicrophone else { - let callMissedTipsModal: CallMissedTipsModal = CallMissedTipsModal(caller: cellViewModel.authorName) + let callMissedTipsModal: CallMissedTipsModal = CallMissedTipsModal( + caller: cellViewModel.authorName, + presentingViewController: self + ) present(callMissedTipsModal, animated: true, completion: nil) return } - - Permissions.requestMicrophonePermissionIfNeeded(presentingViewController: self) return } diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index b1d9705cf..2dd96580a 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -807,7 +807,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD else { preconditionFailure() } let callMissedTipsModal: CallMissedTipsModal = CallMissedTipsModal( - caller: Profile.displayName(id: callerId) + caller: Profile.displayName(id: callerId), + presentingViewController: presentingVC ) presentingVC.present(callMissedTipsModal, animated: true, completion: nil)