@@ -6,8 +6,6 @@ struct SecurityPrivacySettingsView: View {
66 @EnvironmentObject var sheets : SheetViewModel
77 @EnvironmentObject var settings : SettingsViewModel
88
9- @State private var showPinCheckForLaunch = false
10- @State private var showPinCheckForIdle = false
119 @State private var showPinCheckForPayments = false
1210 @State private var showingBiometricError = false
1311 @State private var biometricErrorMessage = " "
@@ -33,6 +31,7 @@ struct SecurityPrivacySettingsView: View {
3331 VStack ( alignment: . leading, spacing: 0 ) {
3432 NavigationBar ( title: t ( " settings__security__title " ) )
3533 . padding ( . bottom, 16 )
34+ . padding ( . horizontal, 16 )
3635
3736 ScrollView ( showsIndicators: false ) {
3837 VStack ( alignment: . leading, spacing: 0 ) {
@@ -83,32 +82,6 @@ struct SecurityPrivacySettingsView: View {
8382 )
8483 }
8584
86- Button {
87- showPinCheckForLaunch = true
88- } label: {
89- SettingsListLabel (
90- title: t ( " settings__security__pin_launch " ) ,
91- rightIcon: nil ,
92- toggle: Binding (
93- get: { settings. requirePinOnLaunch } ,
94- set: { _ in showPinCheckForLaunch = true }
95- )
96- )
97- }
98-
99- Button {
100- showPinCheckForIdle = true
101- } label: {
102- SettingsListLabel (
103- title: t ( " settings__security__pin_idle " ) ,
104- rightIcon: nil ,
105- toggle: Binding (
106- get: { settings. requirePinWhenIdle } ,
107- set: { _ in showPinCheckForIdle = true }
108- )
109- )
110- }
111-
11285 Button {
11386 showPinCheckForPayments = true
11487 } label: {
@@ -122,50 +95,29 @@ struct SecurityPrivacySettingsView: View {
12295 )
12396 }
12497
125- // Biometrics toggle with custom handling
126- SettingsListLabel (
127- title: t (
128- " settings__security__use_bio " ,
129- variables: [ " biometryTypeName " : biometryTypeName]
130- ) ,
131- toggle: Binding (
132- get: { settings. useBiometrics } ,
133- set: { newValue in
134- handleBiometricToggle ( newValue)
135- }
98+ if isBiometricAvailable {
99+ // Biometrics toggle with custom handling
100+ SettingsListLabel (
101+ title: t ( " settings__security__use_bio " , variables: [ " biometryTypeName " : biometryTypeName] ) ,
102+ toggle: Binding (
103+ get: { settings. useBiometrics } ,
104+ set: { newValue in
105+ handleBiometricToggle ( newValue)
106+ }
107+ )
136108 )
137- )
138109
139- // Footer text for Biometrics
140- BodySText ( t ( " settings__security__footer " , variables: [ " biometryTypeName " : biometryTypeName] ) )
141- . padding ( . top, 16 )
110+ // Footer text for Biometrics
111+ BodySText ( t ( " settings__security__footer " , variables: [ " biometryTypeName " : biometryTypeName] ) )
112+ . padding ( . top, 16 )
113+ }
142114 }
143115 }
116+ . padding ( . horizontal, 16 )
144117 . bottomSafeAreaPadding ( )
145118 }
146119 }
147120 . navigationBarHidden ( true )
148- . padding ( . horizontal, 16 )
149- . navigationDestination ( isPresented: $showPinCheckForLaunch) {
150- PinCheckView (
151- title: t ( " security__pin_enter " ) ,
152- explanation: " " ,
153- onCancel: { } ,
154- onPinVerified: { _ in
155- settings. requirePinOnLaunch. toggle ( )
156- }
157- )
158- }
159- . navigationDestination ( isPresented: $showPinCheckForIdle) {
160- PinCheckView (
161- title: t ( " security__pin_enter " ) ,
162- explanation: " " ,
163- onCancel: { } ,
164- onPinVerified: { _ in
165- settings. requirePinWhenIdle. toggle ( )
166- }
167- )
168- }
169121 . navigationDestination ( isPresented: $showPinCheckForPayments) {
170122 PinCheckView (
171123 title: t ( " security__pin_enter " ) ,
@@ -189,12 +141,6 @@ struct SecurityPrivacySettingsView: View {
189141 }
190142
191143 private func handleBiometricToggle( _ newValue: Bool ) {
192- if !isBiometricAvailable {
193- // Biometrics not available - show setup sheet
194- sheets. showSheet ( . security, data: SecurityConfig ( showLaterButton: false ) )
195- return
196- }
197-
198144 if newValue {
199145 // User wants to enable biometrics - request authentication
200146 requestBiometricPermission { success in
0 commit comments