Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions iOSClient/Settings/Settings/NCSettingsModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NCSettingsModel: ObservableObject, ViewOnAppearHandling {
// State to control the lock on/off section
@Published var isLockActive: Bool = false
// State to control the enable TouchID toggle
@Published var enableTouchID: Bool = false
@Published var enableTouchFaceID: Bool = false
// State to control
@Published var lockScreen: Bool = false
// State to control
Expand Down Expand Up @@ -48,7 +48,7 @@ class NCSettingsModel: ObservableObject, ViewOnAppearHandling {
func onViewAppear() {
let capabilities = NCNetworking.shared.capabilities[self.controller?.account ?? ""] ?? NKCapabilities.Capabilities()
isLockActive = (keychain.passcode != nil)
enableTouchID = keychain.touchFaceID
enableTouchFaceID = keychain.touchFaceID
lockScreen = !keychain.requestPasscodeAtStart
privacyScreen = keychain.privacyScreenEnabled
resetWrongAttempts = keychain.resetAppCounterFail
Expand All @@ -62,7 +62,7 @@ class NCSettingsModel: ObservableObject, ViewOnAppearHandling {

/// Function to update Touch ID / Face ID setting
func updateTouchIDSetting() {
keychain.touchFaceID = enableTouchID
keychain.touchFaceID = enableTouchFaceID
}

/// Function to update Lock Screen setting
Expand Down
11 changes: 7 additions & 4 deletions iOSClient/Settings/Settings/NCSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
}
})
// Enable Touch ID
Toggle(NSLocalizedString("_enable_touch_face_id_", comment: ""), isOn: $model.enableTouchID)
.onChange(of: model.enableTouchID) {
Toggle(NSLocalizedString("_enable_touch_face_id_", comment: ""), isOn: $model.enableTouchFaceID)
.onChange(of: model.enableTouchFaceID) {
model.updateTouchIDSetting()
}

Expand All @@ -108,13 +108,15 @@
}

if !NCBrandOptions.shared.enforce_privacyScreenEnabled {
Section {
Section(content: {
// Splash screen when app inactive
Toggle(NSLocalizedString("_privacy_screen_", comment: ""), isOn: $model.privacyScreen)
.onChange(of: model.privacyScreen) {
model.updatePrivacyScreenSetting()
}
}
}, footer: {
Text(NSLocalizedString("_privacy_screen_footer_", comment: ""))
})
.tint(Color(NCBrandColor.shared.getElement(account: model.session.account)))
}

Expand Down Expand Up @@ -288,3 +290,4 @@
#Preview {
NCSettingsView(model: NCSettingsModel(controller: nil))
}

Check warning on line 293 in iOSClient/Settings/Settings/NCSettingsView.swift

View workflow job for this annotation

GitHub Actions / Lint

Trailing Newline Violation: Files should have a single trailing newline (trailing_newline)
6 changes: 4 additions & 2 deletions iOSClient/Settings/Settings/SetupPasscodeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import PopupView
struct SetupPasscodeView: UIViewControllerRepresentable {
@Binding var isLockActive: Bool
var changePasscode: Bool = false
let maxFailedAttempts = 2 // + 1 = 3... The lib failed attempt counter starts at 0. Why? Who knows.
let maxFailedAttempts = 2 // + 1 = 3... The lib's failed attempt counter starts at 0. Why? Who knows.

func makeUIViewController(context: Context) -> UIViewController {
let laContext = LAContext()
Expand Down Expand Up @@ -68,8 +68,10 @@ struct SetupPasscodeView: UIViewControllerRepresentable {
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { success, _ in
DispatchQueue.main.async {
if success {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [self] in
parent.isLockActive = false
NCPreferences().passcode = nil

passcodeViewController.dismiss(animated: true)
}
}
Expand Down
7 changes: 4 additions & 3 deletions iOSClient/Supporting Files/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@
"_full_resolution_image_info_" = "This may reveal more information about the photo.";
"_download_audio_" = "Download the audio locally";
"_copied_path_" = "Copied path";
"_privacy_screen_" = "Splash screen when app inactive";
"_privacy_screen_" = "Hide content when app is inactive";
"_privacy_screen_footer_" = "This will hide the content in the app and show a splash screen when the app is inactive.";
"_in_" = "in";
"_enter_passphrase_" = "Enter passphrase (12 words)";
"_show_more_results_" = "Show more results";
Expand Down Expand Up @@ -602,8 +603,8 @@
"_download_image_" = "Download image";
"_download_video_" = "Download video";
"_reset_wrong_passcode_" = "Reset application";
"_reset_wrong_passcode_option_" = "Reset application after failed attempts";
"_reset_wrong_passcode_desc_" = "Use \"Reset application\" to remove all accounts and local data after %d failed code entry attempts.";
"_reset_wrong_passcode_option_" = "Reset application after 10 failed attempts";
"_reset_wrong_passcode_desc_" = "This setting will remove all accounts and local data after %d failed passcode entry attempts.";
"_deviceOwnerAuthentication_" = "The biometric sensor has been temporarily disabled due to multiple failed attempts. Enter the device passcode to re-enable the sensor.";
"_virus_detect_" = "Virus detected. Upload cannot be completed!";
"_select_photos_" = "Select photos";
Expand Down
Loading