Skip to content

Commit

Permalink
Fix compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed Dec 13, 2024
1 parent d6ed3de commit 0174398
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ enum AppBehavior: String {
private(set) var subscriptionFeatureAvailability: SubscriptionFeatureAvailability!
private var subscriptionCookieManager: SubscriptionCookieManaging!
private var subscriptionCookieManagerFeatureFlagCancellable: AnyCancellable?
private var privacyProDataReporter: PrivacyProDataReporting!
private var _privacyProDataReporter: PrivacyProDataReporting?
var privacyProDataReporter: PrivacyProDataReporting? {
if appBehavior == .stateMachine {
return (appStateMachine.currentState as? Active)?.appDependencies.privacyProDataReporter
} else {
return _privacyProDataReporter
}
}

// MARK: - Feature specific app event handlers

Expand Down Expand Up @@ -386,7 +393,7 @@ enum AppBehavior: String {
self.syncService = syncService

let fireproofing = UserDefaultsFireproofing.xshared
privacyProDataReporter = PrivacyProDataReporter(fireproofing: fireproofing)
_privacyProDataReporter = PrivacyProDataReporter(fireproofing: fireproofing)

isSyncInProgressCancellable = syncService.isSyncInProgressPublisher
.filter { $0 }
Expand Down Expand Up @@ -421,13 +428,13 @@ enum AppBehavior: String {

homePageConfiguration = HomePageConfiguration(variantManager: AppDependencyProvider.shared.variantManager,
remoteMessagingClient: remoteMessagingClient,
privacyProDataReporter: privacyProDataReporter)
privacyProDataReporter: _privacyProDataReporter!)

let previewsSource = TabPreviewsSource()
let historyManager = makeHistoryManager()
let tabsModel = prepareTabsModel(previewsSource: previewsSource)

privacyProDataReporter.injectTabsModel(tabsModel)
_privacyProDataReporter!.injectTabsModel(tabsModel)

if shouldPresentInsufficientDiskSpaceAlertAndCrash {

Expand All @@ -450,7 +457,7 @@ enum AppBehavior: String {
previewsSource: previewsSource,
tabsModel: tabsModel,
syncPausedStateManager: syncErrorHandler,
privacyProDataReporter: privacyProDataReporter,
privacyProDataReporter: _privacyProDataReporter!,
variantManager: variantManager,
contextualOnboardingPresenter: contextualOnboardingPresenter,
contextualOnboardingLogic: daxDialogs,
Expand Down Expand Up @@ -726,7 +733,7 @@ enum AppBehavior: String {

syncService.scheduler.notifyAppLifecycleEvent()

privacyProDataReporter.injectSyncService(syncService)
_privacyProDataReporter?.injectSyncService(syncService)

fireFailedCompilationsPixelIfNeeded()

Expand Down Expand Up @@ -762,7 +769,7 @@ enum AppBehavior: String {
importPasswordsStatusHandler.checkSyncSuccessStatus()

Task {
await privacyProDataReporter.saveWidgetAdded()
await _privacyProDataReporter?.saveWidgetAdded()
}

AppDependencyProvider.shared.persistentPixel.sendQueuedPixels { _ in }
Expand Down Expand Up @@ -887,7 +894,7 @@ enum AppBehavior: String {
AppDependencyProvider.shared.autofillLoginSession.endSession()
suspendSync()
syncDataProviders.bookmarksAdapter.cancelFaviconsFetching(application)
privacyProDataReporter.saveApplicationLastSessionEnded()
_privacyProDataReporter?.saveApplicationLastSessionEnded()
resetAppStartTime()
}
}
Expand Down

0 comments on commit 0174398

Please sign in to comment.