From 44943bfde74582921e01ca119dcb5c021235847e Mon Sep 17 00:00:00 2001 From: "roux g. buciu" Date: Fri, 13 Dec 2024 12:35:49 -0500 Subject: [PATCH] Stop spammy logs for Menu --- .../Browser/BrowserCoordinator.swift | 16 ------- .../MainMenu/MainMenuCoordinator.swift | 47 ++++++------------- 2 files changed, 14 insertions(+), 49 deletions(-) diff --git a/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift b/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift index 32407071f013..177053aca582 100644 --- a/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift +++ b/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift @@ -590,14 +590,6 @@ class BrowserCoordinator: BaseCoordinator, private func makeMenuNavViewController() -> DismissableNavigationViewController? { if let mainMenuCoordinator = childCoordinators.first(where: { $0 is MainMenuCoordinator }) as? MainMenuCoordinator { - logger.log( - "MainMenuCoordinator already exists when it shouldn't. Removing and recreating it to access menu", - level: .fatal, - category: .mainMenu, - extra: ["existing mainMenuCoordinator UUID": "\(mainMenuCoordinator.windowUUID)", - "BrowserCoordinator windowUUID": "\(windowUUID)"] - ) - mainMenuCoordinator.dismissMenuModal(animated: false) } @@ -619,14 +611,6 @@ class BrowserCoordinator: BaseCoordinator, add(child: coordinator) coordinator.start() - navigationController.onViewDismissed = { [weak self] in - self?.logger.log( - "MainMenu NavigationController - onViewDismissed", - level: .info, - category: .mainMenu - ) - } - return navigationController } diff --git a/firefox-ios/Client/Frontend/Browser/MainMenu/MainMenuCoordinator.swift b/firefox-ios/Client/Frontend/Browser/MainMenu/MainMenuCoordinator.swift index 44aba5ddb351..16ff50423fe9 100644 --- a/firefox-ios/Client/Frontend/Browser/MainMenu/MainMenuCoordinator.swift +++ b/firefox-ios/Client/Frontend/Browser/MainMenu/MainMenuCoordinator.swift @@ -38,20 +38,7 @@ class MainMenuCoordinator: BaseCoordinator, FeatureFlaggable { super.init(router: router) } - deinit { - logger.log( - "MainMenuCoordinator - deinitialized", - level: .info, - category: .mainMenu - ) - } - func start() { - logger.log( - "MainMenuCoordinator - started", - level: .info, - category: .mainMenu - ) router.setRootViewController( createMainMenuViewController(), hideBar: true @@ -59,11 +46,6 @@ class MainMenuCoordinator: BaseCoordinator, FeatureFlaggable { } func showDetailViewController() { - logger.log( - "MainMenuCoordinator - pushing detail view controller", - level: .info, - category: .mainMenu - ) router.push( createMainMenuDetailViewController(), animated: true @@ -71,29 +53,14 @@ class MainMenuCoordinator: BaseCoordinator, FeatureFlaggable { } func dismissDetailViewController() { - logger.log( - "MainMenuCoordinator - popping detail view controller", - level: .info, - category: .mainMenu - ) router.popViewController(animated: true) } func removeCoordinatorFromParent() { - logger.log( - "MainMenuCoordinator - removing coordinator from parent", - level: .info, - category: .mainMenu - ) parentCoordinator?.didFinish(from: self) } func dismissMenuModal(animated: Bool) { - logger.log( - "MainMenuCoordinator - dismissing main menu", - level: .info, - category: .mainMenu - ) router.dismiss(animated: animated, completion: nil) removeCoordinatorFromParent() } @@ -105,26 +72,37 @@ class MainMenuCoordinator: BaseCoordinator, FeatureFlaggable { switch destination.destination { case .bookmarks: self.navigationHandler?.showLibraryPanel(.bookmarks) + case .customizeHomepage: self.navigationHandler?.showSettings(at: .homePage) + case .downloads: self.navigationHandler?.showLibraryPanel(.downloads) + case .editBookmark: self.navigationHandler?.editLatestBookmark() + case .findInPage: self.navigationHandler?.showFindInPage() + case .goToURL: self.navigationHandler?.openURLInNewTab(destination.url) + case .history: self.navigationHandler?.showLibraryPanel(.history) + case .newTab: self.navigationHandler?.openNewTab(inPrivateMode: false) + case .newPrivateTab: self.navigationHandler?.openNewTab(inPrivateMode: true) + case .passwords: self.navigationHandler?.showSettings(at: .password) + case .settings: self.navigationHandler?.showSettings(at: .general) + case .syncSignIn: let fxaParameters = FxASignInViewParameters( launchParameters: FxALaunchParams(entrypoint: .browserMenu, query: [:]), @@ -132,8 +110,10 @@ class MainMenuCoordinator: BaseCoordinator, FeatureFlaggable { referringPage: .appMenu ) self.navigationHandler?.showSignInView(fxaParameters: fxaParameters) + case .shareSheet: self.navigationHandler?.showShareSheetForCurrentlySelectedTab() + case .zoom: self.navigationHandler?.updateZoomPageBarVisibility() } @@ -143,6 +123,7 @@ class MainMenuCoordinator: BaseCoordinator, FeatureFlaggable { } // MARK: - Private helpers + private func createMainMenuViewController() -> MainMenuViewController { let mainMenuViewController = MainMenuViewController(windowUUID: windowUUID, profile: profile) mainMenuViewController.coordinator = self