diff --git a/DuckDuckGo/NetworkProtectionTunnelController.swift b/DuckDuckGo/NetworkProtectionTunnelController.swift index fe6e1620ee..c7b8ebee6d 100644 --- a/DuckDuckGo/NetworkProtectionTunnelController.swift +++ b/DuckDuckGo/NetworkProtectionTunnelController.swift @@ -322,7 +322,8 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr private func subscribeToConfigurationChanges() { notificationCenter.publisher(for: .NEVPNConfigurationChange) .receive(on: DispatchQueue.main) - .sink { _ in + .sink { [weak self] _ in + guard let self = self else { return } Task { @MainActor in guard let manager = self.internalManager else { return @@ -346,7 +347,9 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr private func subscribeToStatusChanges() { notificationCenter.publisher(for: .NEVPNStatusDidChange) - .sink(receiveValue: handleStatusChange(_:)) + .sink { [weak self] value in + self?.handleStatusChange(value) + } .store(in: &cancellables) } diff --git a/DuckDuckGo/StubAutofillLoginImportStateProvider.swift b/DuckDuckGo/StubAutofillLoginImportStateProvider.swift index 326659f898..2b9c6382ab 100644 --- a/DuckDuckGo/StubAutofillLoginImportStateProvider.swift +++ b/DuckDuckGo/StubAutofillLoginImportStateProvider.swift @@ -26,10 +26,10 @@ struct StubAutofillLoginImportStateProvider: AutofillLoginImportStateProvider { var credentialsImportPromptPresentationCount: Int = 0 var isAutofillEnabled: Bool { - AppDependencyProvider().appSettings.autofillCredentialsEnabled + AppDependencyProvider.shared.appSettings.autofillCredentialsEnabled } func hasNeverPromptWebsitesFor(_ domain: String) -> Bool { - AppDependencyProvider().autofillNeverPromptWebsitesManager.hasNeverPromptWebsitesFor(domain: domain) + AppDependencyProvider.shared.autofillNeverPromptWebsitesManager.hasNeverPromptWebsitesFor(domain: domain) } } diff --git a/DuckDuckGo/TabManager.swift b/DuckDuckGo/TabManager.swift index 1d7fadf8ca..24077c9454 100644 --- a/DuckDuckGo/TabManager.swift +++ b/DuckDuckGo/TabManager.swift @@ -89,7 +89,7 @@ class TabManager { contextualOnboardingPresenter: contextualOnboardingPresenter, contextualOnboardingLogic: contextualOnboardingLogic, onboardingPixelReporter: onboardingPixelReporter, - featureFlagger: AppDependencyProvider().featureFlagger) + featureFlagger: AppDependencyProvider.shared.featureFlagger) controller.applyInheritedAttribution(inheritedAttribution) controller.attachWebView(configuration: configuration, andLoadRequest: url == nil ? nil : URLRequest.userInitiated(url!), @@ -167,7 +167,7 @@ class TabManager { contextualOnboardingPresenter: contextualOnboardingPresenter, contextualOnboardingLogic: contextualOnboardingLogic, onboardingPixelReporter: onboardingPixelReporter, - featureFlagger: AppDependencyProvider().featureFlagger) + featureFlagger: AppDependencyProvider.shared.featureFlagger) controller.attachWebView(configuration: configCopy, andLoadRequest: request, consumeCookies: !model.hasActiveTabs, diff --git a/DuckDuckGo/TabViewControllerLongPressMenuExtension.swift b/DuckDuckGo/TabViewControllerLongPressMenuExtension.swift index 938abdacd5..38770be4e7 100644 --- a/DuckDuckGo/TabViewControllerLongPressMenuExtension.swift +++ b/DuckDuckGo/TabViewControllerLongPressMenuExtension.swift @@ -111,7 +111,7 @@ extension TabViewController { contextualOnboardingPresenter: contextualOnboardingPresenter, contextualOnboardingLogic: contextualOnboardingLogic, onboardingPixelReporter: onboardingPixelReporter, - featureFlagger: AppDependencyProvider().featureFlagger) + featureFlagger: AppDependencyProvider.shared.featureFlagger) tabController.isLinkPreview = true let configuration = WKWebViewConfiguration.nonPersistent() tabController.attachWebView(configuration: configuration, andLoadRequest: URLRequest.userInitiated(url), consumeCookies: false)