diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 34adb3a19..5aad5e287 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -4625,6 +4625,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni { [secureBackupSetupCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; secureBackupSetupCoordinatorBridgePresenter = nil; + + // BWI: #5706 fix alert triggering for new users + [self afterAppUnlockedByPin:[UIApplication sharedApplication]]; } - (void)secureBackupSetupCoordinatorBridgePresenterDelegateDidCancel:(SecureBackupSetupCoordinatorBridgePresenter *)coordinatorBridgePresenter diff --git a/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift b/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift index 7f92f15f6..e7442a7d9 100644 --- a/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift +++ b/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift @@ -800,7 +800,16 @@ extension AllChatsCoordinator: AllChatsViewControllerDelegate { func allChatsViewControllerDidCompleteAuthentication(_ allChatsViewController: AllChatsViewController) { self.delegate?.splitViewMasterCoordinatorDidCompleteAuthentication(self) - onBWIAppStart() + // BWI: #5706 fix alert triggering for new users. Only trigger onBWIAppStart when session has recovery set + guard let matrixSession = self.parameters.userSessionsService.mainUserSession?.matrixSession else { + return + } + guard let crypto = matrixSession.crypto else { + return + } + if crypto.recoveryService.hasRecovery() { + onBWIAppStart() + } } func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomWithParameters roomNavigationParameters: RoomNavigationParameters, completion: @escaping () -> Void) { diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index 1e0b8c109..b566d8463 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -325,6 +325,10 @@ class AllChatsViewController: HomeViewController { } func presentFederationIntroductionSheet() { + guard let mainSession = self.mainSession else { + return + } + guard BWIBuildSettings.shared.showFederationIntroduction else { return } @@ -333,7 +337,7 @@ class AllChatsViewController: HomeViewController { return } - guard self.mainSession.homeserverWellknown.shouldShowFederationIntroduction() else { + guard mainSession.homeserverWellknown.shouldShowFederationIntroduction() else { return } @@ -523,7 +527,11 @@ class AllChatsViewController: HomeViewController { // bwi: 5706 show federation announcement promt func bwiCheckForFederationAnnouncementPromt() { - guard self.mainSession.homeserverWellknown.shouldShowFederationAnnouncement() else { + guard let mainSession = self.mainSession else { + return + } + + guard mainSession.homeserverWellknown.shouldShowFederationAnnouncement() else { return }