Skip to content

Commit

Permalink
assign tab delegate when attaching
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Apr 3, 2024
1 parent 6b30b04 commit 8c9c6d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 1 addition & 2 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ class MainViewController: UIViewController {

super.init(nibName: nil, bundle: nil)

tabManager.delegate = self
bindFavoritesDisplayMode()
bindSyncService()
}
Expand Down Expand Up @@ -228,7 +227,6 @@ class MainViewController: UIViewController {

super.init(nibName: nil, bundle: nil)

self.tabManager.delegate = self

bindSyncService()
}
Expand Down Expand Up @@ -984,6 +982,7 @@ class MainViewController: UIViewController {
currentTab?.progressWorker.progressBar = nil
currentTab?.chromeDelegate = nil

tab.delegate = self
addToContentContainer(controller: tab)

viewCoordinator.logoContainer.isHidden = true
Expand Down
3 changes: 0 additions & 3 deletions DuckDuckGo/TabManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class TabManager {
private let historyManager: HistoryManager
private let syncService: DDGSyncing
private var previewsSource: TabPreviewsSource
weak var delegate: TabDelegate?

@UserDefaultsWrapper(key: .faviconTabsCacheNeedsCleanup, defaultValue: true)
var tabsCacheNeedsCleanup: Bool
Expand Down Expand Up @@ -78,7 +77,6 @@ class TabManager {
controller.attachWebView(configuration: configuration,
andLoadRequest: url == nil ? nil : URLRequest.userInitiated(url!),
consumeCookies: !model.hasActiveTabs)
controller.delegate = delegate
controller.loadViewIfNeeded()
return controller
}
Expand Down Expand Up @@ -150,7 +148,6 @@ class TabManager {
andLoadRequest: request,
consumeCookies: !model.hasActiveTabs,
loadingInitiatedByParentTab: true)
controller.delegate = delegate
controller.loadViewIfNeeded()
controller.applyInheritedAttribution(inheritedAttribution)
tabControllerCache.append(controller)
Expand Down

0 comments on commit 8c9c6d6

Please sign in to comment.