From 1952f83a75762e40a0f60065b35a72d39d0c5869 Mon Sep 17 00:00:00 2001 From: Graeme Arthur <2030310+graeme@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:27:30 +0200 Subject: [PATCH] Only show for all users if feature flag is enabled --- .../DataImport/Logins/AutofillLoginImportState.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/DataImport/Logins/AutofillLoginImportState.swift b/DuckDuckGo/DataImport/Logins/AutofillLoginImportState.swift index fd99f19659..43983b8e08 100644 --- a/DuckDuckGo/DataImport/Logins/AutofillLoginImportState.swift +++ b/DuckDuckGo/DataImport/Logins/AutofillLoginImportState.swift @@ -30,8 +30,12 @@ final class AutofillLoginImportState: AutofillLoginImportStateProvider, Autofill } private let userDefaults: UserDefaults + private let featureFlagger: FeatureFlagger public var isEligibleDDGUser: Bool { + guard !featureFlagger.isFeatureOn(.credentialsImportPromptForAllUsers) else { + return true + } guard let date = userDefaults.object(forKey: UserDefaultsWrapper.Key.firstLaunchDate.rawValue) as? Date else { return true } @@ -72,8 +76,9 @@ final class AutofillLoginImportState: AutofillLoginImportStateProvider, Autofill } } - init(userDefaults: UserDefaults = .standard) { + init(userDefaults: UserDefaults = .standard, featureFlagger: FeatureFlagger = NSApp.delegateTyped.featureFlagger) { self.userDefaults = userDefaults + self.featureFlagger = featureFlagger } func hasNeverPromptWebsitesFor(_ domain: String) -> Bool {