Skip to content

Commit

Permalink
Update preference panes order on subscription builds
Browse files Browse the repository at this point in the history
  • Loading branch information
miasma13 committed Sep 29, 2023
1 parent ce7ffc6 commit 091fa5b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions DuckDuckGo/Preferences/Model/PreferencesSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,25 @@ struct PreferencesSection: Hashable, Identifiable {
@MainActor
static func defaultSections(includingDuckPlayer: Bool) -> [PreferencesSection] {
let regularPanes: [PreferencePaneIdentifier] = {
var panes: [PreferencePaneIdentifier] = [.general, .appearance, .privacy, .autofill, .downloads]
#if SUBSCRIPTION
if let privacyIndex = panes.firstIndex(of: .privacy) {
panes.insert(.subscription, at: privacyIndex + 1)
var panes: [PreferencePaneIdentifier] = [.privacy, .subscription, .general, .appearance, .autofill, .downloads]

if (NSApp.delegate as? AppDelegate)?.internalUserDecider?.isInternalUser == true {
if let generalIndex = panes.firstIndex(of: .general) {
panes.insert(.sync, at: generalIndex + 1)
}
}
#else
var panes: [PreferencePaneIdentifier] = [.general, .appearance, .privacy, .autofill, .downloads]

if (NSApp.delegate as? AppDelegate)?.internalUserDecider?.isInternalUser == true {
panes.insert(.sync, at: 1)
}
#endif
if includingDuckPlayer {
panes.append(.duckPlayer)
}
if (NSApp.delegate as? AppDelegate)?.internalUserDecider?.isInternalUser == true {
panes.insert(.sync, at: 1)
}

return panes
}()

Expand Down

0 comments on commit 091fa5b

Please sign in to comment.