Skip to content

Commit

Permalink
Only show for all users if feature flag is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme committed Sep 27, 2024
1 parent 6a3477d commit 1952f83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion DuckDuckGo/DataImport/Logins/AutofillLoginImportState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Date>.Key.firstLaunchDate.rawValue) as? Date else {
return true
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1952f83

Please sign in to comment.