@@ -51,7 +51,21 @@ struct SettingView: View {
5151 #if canImport(UIKit)
5252 . textInputAutocapitalization( . never)
5353 #endif
54- HStack {
54+ #if os(macOS)
55+ HStack {
56+ Button ( " Save " ) {
57+ let trimmed = deviceIdDraft. trimmingCharacters ( in: . whitespacesAndNewlines)
58+ guard !trimmed. isEmpty else { return }
59+ vm. deviceIdentifier = trimmed
60+ ApplePackage . Configuration. deviceIdentifier = trimmed
61+ editingDeviceId = false
62+ }
63+ Button ( " Cancel " , role: . destructive) {
64+ editingDeviceId = false
65+ }
66+ Spacer ( )
67+ }
68+ #else
5569 Button ( " Save " ) {
5670 let trimmed = deviceIdDraft. trimmingCharacters ( in: . whitespacesAndNewlines)
5771 guard !trimmed. isEmpty else { return }
@@ -62,31 +76,30 @@ struct SettingView: View {
6276 Button ( " Cancel " , role: . destructive) {
6377 editingDeviceId = false
6478 }
65- Spacer ( )
66- }
79+ #endif
6780 } else {
6881 Text ( vm. deviceIdentifier)
6982 . font ( . system( . body, design: . monospaced) )
7083 . textSelection ( . enabled)
7184 . redacted ( reason: . placeholder, isEnabled: vm. demoMode)
72- HStack {
73- #if canImport(UIKit)
74- Button ( " Open Settings " ) {
75- openURL ( URL ( string: UIApplication . openSettingsURLString) !)
76- }
77- Button ( " Install Certificate " ) {
78- openURL ( Installer . caURL)
79- }
80- #else
85+ #if os(macOS)
86+ HStack {
8187 Button ( " Open Settings " ) {
8288 openURL ( URL ( string: " x-apple.systempreferences: " ) !)
8389 }
8490 Button ( " Show Certificate in Finder " ) {
8591 NSWorkspace . shared. activateFileViewerSelecting ( [ Installer . ca] )
8692 }
87- #endif
88- Spacer ( )
89- }
93+ Spacer ( )
94+ }
95+ #else
96+ Button ( " Open Settings " ) {
97+ openURL ( URL ( string: UIApplication . openSettingsURLString) !)
98+ }
99+ Button ( " Install Certificate " ) {
100+ openURL ( Installer . caURL)
101+ }
102+ #endif
90103 }
91104 } header: {
92105 Text ( " Device " )
0 commit comments