Skip to content

Commit

Permalink
Code deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstrba committed Sep 20, 2023
1 parent b218ff9 commit 81cac8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions DuckDuckGo/Common/Extensions/URLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,8 @@ extension URL {
}

}

// MARK: - System Settings

static var fullDiskAccess = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles")
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class ConnectBitwardenViewModel: ObservableObject {
} else if viewState == .disclaimer {
viewState = .lookingForBitwarden
} else if viewState == .accessToContainersNotApproved {
guard let link = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles") else {
guard let link = URL.fullDiskAccess else {
assertionFailure("Can't initialize link to Settings")
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ final class AutofillPreferencesModel: ObservableObject {
}

func openSettings() {
guard let link = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles") else {
guard let link = URL.fullDiskAccess else {
assertionFailure("Can't initialize link to Settings")
return
}
Expand Down

0 comments on commit 81cac8b

Please sign in to comment.