Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix circular reference in AddressBarModel #3733

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions DuckDuckGo/HomePage/Model/HomePageAddressBarModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ extension HomePage.Models {
}
}

let tabCollectionViewModel: TabCollectionViewModel
private weak var tabCollectionViewModel: TabCollectionViewModel?

private var isExperimentActive: Bool = false {
didSet {
Expand Down Expand Up @@ -140,9 +140,7 @@ extension HomePage.Models {
let storyboard = NSStoryboard(name: "NavigationBar", bundle: .main)
let viewController: AddressBarViewController = storyboard
.instantiateController(identifier: "AddressBarViewController") { [weak self] coder in
guard let self else {
return nil
}
guard let self, let tabCollectionViewModel else { return nil }
return AddressBarViewController(
coder: coder,
tabCollectionViewModel: tabCollectionViewModel,
Expand Down Expand Up @@ -170,7 +168,7 @@ extension HomePage.Models {
}

private func subscribeToCustomBackground(_ viewController: AddressBarViewController) {
guard !tabCollectionViewModel.isBurner else {
guard let tabCollectionViewModel, !tabCollectionViewModel.isBurner else {
return
}

Expand Down
Loading