Skip to content

Commit

Permalink
Add Preferences Views.
Browse files Browse the repository at this point in the history
  • Loading branch information
not-a-rootkit committed Sep 3, 2024
1 parent 2b37d16 commit 215a8ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions DuckDuckGo/Preferences/View/PreferencesGeneralView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ extension Preferences {
@ObservedObject var searchModel: SearchPreferences
@ObservedObject var tabsModel: TabsPreferences
@ObservedObject var dataClearingModel: DataClearingPreferences
@ObservedObject var phishingDetectionModel: PhishingDetectionPreferences
@State private var showingCustomHomePageSheet = false
@State private var isAddedToDock = false
var dockCustomizer: DockCustomizer
let featureFlagger = NSApp.delegateTyped.featureFlagger

var body: some View {
PreferencePane(UserText.general) {
Expand Down Expand Up @@ -190,6 +192,20 @@ extension Preferences {
isOn: $downloadsModel.alwaysRequestDownloadLocation)
}
}

// SECTION 7: Phishing Detection
if featureFlagger.isFeatureOn(.phishingDetectionPreferences) {
PreferencePaneSection(UserText.phishingDetectionHeader) {
PreferencePaneSubSection {
ToggleMenuItem(UserText.phishingDetectionIsEnabled,
isOn: $phishingDetectionModel.isEnabled)
}.padding(.bottom, 5)
Text(UserText.phishingDetectionEnabledWarning)
.font(.footnote)
.foregroundColor(.red)
.padding(.top, 5)
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Preferences/View/PreferencesRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ enum Preferences {
searchModel: SearchPreferences.shared,
tabsModel: TabsPreferences.shared,
dataClearingModel: DataClearingPreferences.shared,
dockCustomizer: DockCustomizer())
phishingDetectionModel: PhishingDetectionPreferences.shared, dockCustomizer: DockCustomizer())
case .sync:
SyncView()
case .appearance:
Expand Down

0 comments on commit 215a8ba

Please sign in to comment.