Skip to content

Commit

Permalink
Remove readerTabViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Sep 16, 2024
1 parent dca86e8 commit df6b060
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ extension MySitesCoordinator: RootViewPresenter {

// MARK: Reader

var readerTabViewController: ReaderTabViewController? {
unsupportedFeatureFallback()
return nil
}

var readerCoordinator: ReaderCoordinator? {
unsupportedFeatureFallback()
return nil
Expand Down
1 change: 0 additions & 1 deletion WordPress/Classes/System/RootViewPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ protocol RootViewPresenter: AnyObject {

// MARK: Reader

var readerTabViewController: ReaderTabViewController? { get }
var readerCoordinator: ReaderCoordinator? { get }
var readerNavigationController: UINavigationController? { get }
func showReaderTab()
Expand Down
2 changes: 0 additions & 2 deletions WordPress/Classes/System/SplitViewRootPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ final class SplitViewRootPresenter: RootViewPresenter {
return siteContent?.blog
}

var readerTabViewController: ReaderTabViewController?

var readerCoordinator: ReaderCoordinator? {
ReaderCoordinator()
}
Expand Down
4 changes: 0 additions & 4 deletions WordPress/Classes/System/StaticScreensTabBarWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class StaticScreensTabBarWrapper: RootViewPresenter {

// MARK: Reader

var readerTabViewController: ReaderTabViewController? {
return nil
}

var readerCoordinator: ReaderCoordinator? {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ class ReaderTabViewController: UIViewController {
ReaderTracker.shared.start(.main)
}

func presentDiscoverTab() {
viewModel.fetchReaderMenu()
viewModel.showTab(at: ReaderTabConstants.discoverIndex)
displayNotice(title: NSLocalizedString("Comment to start making connections.", comment: "Hint for users to grow their audience by commenting on other blogs."))
}

// MARK: - Reader FAB

private func createFABIfNeeded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ protocol ReaderContentViewController: UIViewController {

// MARK: - Reader Factory
extension WPTabBarController {
var readerTabViewController: ReaderTabViewController? {
readerNavigationController?.topViewController as? ReaderTabViewController
}

@objc func makeReaderTabViewController() -> ReaderTabViewController {
return ReaderTabViewController(viewModel: readerTabViewModel) { [weak self] viewModel in
guard let self else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,9 @@ extension SiteStatsInsightsTableViewController: SiteStatsInsightsDelegate {
}

self.navigationController?.popToRootViewController(animated: false)
RootViewCoordinator.sharedPresenter.showReaderTab()
if let vc = RootViewCoordinator.sharedPresenter.readerTabViewController {
vc.presentDiscoverTab()
}
RootViewCoordinator.sharedPresenter.switchToDiscover()

Notice(title: NSLocalizedString("Comment to start making connections.", comment: "Hint for users to grow their audience by commenting on other blogs.")).post()
}

let nc = UINavigationController(rootViewController: vc)
Expand Down

0 comments on commit df6b060

Please sign in to comment.