diff --git a/Client/Frontend/Browser/PrivacyHub/PrivacyReportsManager.swift b/Client/Frontend/Browser/PrivacyHub/PrivacyReportsManager.swift index 05ab5116f9e..b8c7975aa5d 100644 --- a/Client/Frontend/Browser/PrivacyHub/PrivacyReportsManager.swift +++ b/Client/Frontend/Browser/PrivacyHub/PrivacyReportsManager.swift @@ -65,7 +65,11 @@ public struct PrivacyReportsManager { } public static func consolidateData(dayRange range: Int = 30) { - if Date() < Preferences.PrivacyReports.nextConsolidationDate.value { + if Preferences.PrivacyReports.nextConsolidationDate.value == nil { + Preferences.PrivacyReports.nextConsolidationDate.value = Date().advanced(by: 7.days) + } + + if let consolidationDate = Preferences.PrivacyReports.nextConsolidationDate.value, Date() < consolidationDate { return } diff --git a/Client/Frontend/ClientPreferences.swift b/Client/Frontend/ClientPreferences.swift index e93a90a32d9..900bb634f41 100644 --- a/Client/Frontend/ClientPreferences.swift +++ b/Client/Frontend/ClientPreferences.swift @@ -309,7 +309,7 @@ extension Preferences { static let captureVPNAlerts = Option(key: "privacy-hub.capture-vpn-alerts", default: true) /// Tracker when to consolidate tracker and vpn data. By default the first consolidation happens 7 days after Privacy Reports build is installed. static let nextConsolidationDate = - Option(key: "privacy-hub.next-consolidation-date", default: Date().advanced(by: 7.days)) + Option(key: "privacy-hub.next-consolidation-date", default: nil) /// Determines whether to show a Privacy Reports onboarding popup on the NTP. public static let ntpOnboardingCompleted = Option(key: "privacy-hub.onboarding-completed", default: true)