Skip to content

Commit

Permalink
Stop spammy logs for Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
adudenamedruby committed Dec 13, 2024
1 parent d66c6d2 commit 44943bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 49 deletions.
16 changes: 0 additions & 16 deletions firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,62 +38,29 @@ 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
)
}

func showDetailViewController() {
logger.log(
"MainMenuCoordinator - pushing detail view controller",
level: .info,
category: .mainMenu
)
router.push(
createMainMenuDetailViewController(),
animated: true
)
}

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()
}
Expand All @@ -105,35 +72,48 @@ 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: [:]),
flowType: .emailLoginFlow,
referringPage: .appMenu
)
self.navigationHandler?.showSignInView(fxaParameters: fxaParameters)

case .shareSheet:
self.navigationHandler?.showShareSheetForCurrentlySelectedTab()

case .zoom:
self.navigationHandler?.updateZoomPageBarVisibility()
}
Expand All @@ -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
Expand Down

0 comments on commit 44943bf

Please sign in to comment.