Skip to content

Commit

Permalink
Fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thatswinnie committed Dec 5, 2023
1 parent 41de0aa commit 58f47cf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 80 deletions.
42 changes: 2 additions & 40 deletions Client/Frontend/Browser/Tabs/TabDisplayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ class TabDisplayViewController: UIViewController,
private var backgroundPrivacyOverlay: UIView = .build()
private lazy var emptyPrivateTabsView: EmptyPrivateTabsView = .build()

<<<<<<< HEAD:Client/Frontend/Browser/Tabs/TabDisplayViewController.swift
// MARK: Redux state
var tabsState: TabsState
=======
var tabsState: TabsPanelState
>>>>>>> b7db64ae9 (Refactor FXIOS-7853 [v122] Redux pattern protocol improvements (#17542)):Client/Frontend/Browser/Tabs/Views/TabDisplayPanel.swift

init(isPrivateMode: Bool,
notificationCenter: NotificationProtocol = NotificationCenter.default,
Expand All @@ -55,25 +50,7 @@ class TabDisplayViewController: UIViewController,
setupView()
listenForThemeChange(view)
applyTheme()
<<<<<<< HEAD:Client/Frontend/Browser/Tabs/TabDisplayViewController.swift
subscribeRedux()
}

private func subscribeRedux() {
store.dispatch(ActiveScreensStateAction.showScreen(.tabsPanel))
store.dispatch(TabPanelAction.tabPanelDidLoad(tabsState.isPrivateMode))
store.subscribe(self, transform: {
return $0.select(TabsState.init)
})
}

func newState(state: TabsState) {
tabsState = state
tabDisplayView.newState(state: tabsState)
shouldShowEmptyView(tabsState.isPrivateTabsEmpty)
=======
subscribeToRedux()
>>>>>>> b7db64ae9 (Refactor FXIOS-7853 [v122] Redux pattern protocol improvements (#17542)):Client/Frontend/Browser/Tabs/Views/TabDisplayPanel.swift
}

func setupView() {
Expand Down Expand Up @@ -129,7 +106,7 @@ class TabDisplayViewController: UIViewController,
store.dispatch(ActiveScreensStateAction.showScreen(.tabsPanel))
store.dispatch(TabPanelAction.tabPanelDidLoad(tabsState.isPrivateMode))
store.subscribe(self, transform: {
return $0.select(TabsPanelState.init)
return $0.select(TabsState.init)
})
}

Expand All @@ -138,27 +115,12 @@ class TabDisplayViewController: UIViewController,
store.unsubscribe(self)
}

func newState(state: TabsPanelState) {
func newState(state: TabsState) {
tabsState = state
tabDisplayView.newState(state: tabsState)
shouldShowEmptyView(tabsState.isPrivateTabsEmpty)
}

// MARK: EmptyPrivateTabsViewDelegate
<<<<<<< HEAD:Client/Frontend/Browser/Tabs/TabDisplayViewController.swift
func didTapLearnMore(urlRequest: URLRequest) {}
=======

func didTapLearnMore(urlRequest: URLRequest) {
store.dispatch(TabPanelAction.learnMorePrivateMode(urlRequest))
}
}

extension TabDisplayPanel: TabPeekDelegate {
func tabPeekDidAddToReadingList(_ tab: Tab) -> ReadingListItem? { return nil }
func tabPeekDidAddBookmark(_ tab: Tab) {}
func tabPeekRequestsPresentationOf(_ viewController: UIViewController) {}
func tabPeekDidCloseTab(_ tab: Tab) {}
func tabPeekDidCopyUrl() {}
>>>>>>> b7db64ae9 (Refactor FXIOS-7853 [v122] Redux pattern protocol improvements (#17542)):Client/Frontend/Browser/Tabs/Views/TabDisplayPanel.swift
}
22 changes: 0 additions & 22 deletions Client/Frontend/Browser/Tabs/TabTrayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,24 +229,7 @@ class TabTrayViewController: UIViewController,
super.viewDidDisappear(animated)
delegate?.didFinish()

<<<<<<< HEAD:Client/Frontend/Browser/Tabs/TabTrayViewController.swift
store.dispatch(ActiveScreensStateAction.closeScreen(.tabsTray))
store.unsubscribe(self)
}

private func subscribeRedux() {
store.dispatch(ActiveScreensStateAction.showScreen(.tabsTray))
store.dispatch(TabTrayAction.tabTrayDidLoad(tabTrayState.selectedPanel))
store.subscribe(self, transform: {
return $0.select(TabTrayState.init)
})
}

func newState(state: TabTrayState) {
tabTrayState = state
=======
unsubscribeFromRedux()
>>>>>>> b7db64ae9 (Refactor FXIOS-7853 [v122] Redux pattern protocol improvements (#17542)):Client/Frontend/Browser/Tabs/Views/TabTrayViewController.swift
}

private func updateLayout() {
Expand Down Expand Up @@ -280,11 +263,6 @@ class TabTrayViewController: UIViewController,
}

func newState(state: TabTrayState) {
tabTrayState = state

if tabTrayState.shouldDismiss {
dismissVC()
}
}

// MARK: Themeable
Expand Down
18 changes: 0 additions & 18 deletions Client/Frontend/Home/HomepageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ class HomepageViewController: UIViewController, FeatureFlaggable, Themeable, Con
jumpBackInContextualHintViewController.stopTimer()
syncTabContextualHintViewController.stopTimer()
notificationCenter.removeObserver(self)
<<<<<<< HEAD
=======
unsubscribeFromRedux()
>>>>>>> b7db64ae9 (Refactor FXIOS-7853 [v122] Redux pattern protocol improvements (#17542))
}

// MARK: - View lifecycle
Expand Down Expand Up @@ -259,20 +255,6 @@ class HomepageViewController: UIViewController, FeatureFlaggable, Themeable, Con
return layout
}

// MARK: - Redux

func subscribeToRedux() {
store.subscribe(self)
}

func unsubscribeFromRedux() {
store.unsubscribe(self)
}

func newState(state: AppState) {
// TODO: https://mozilla-hub.atlassian.net/browse/FXIOS-7190
}

// MARK: Long press

private lazy var longPressRecognizer: UILongPressGestureRecognizer = {
Expand Down

0 comments on commit 58f47cf

Please sign in to comment.