Skip to content

Commit

Permalink
fixed an issue can activate the faceid switch without a passcode
Browse files Browse the repository at this point in the history
  • Loading branch information
charliescheer committed May 15, 2024
1 parent 75337a0 commit 14904c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ extension SPSettingsViewController: PinLockSetupControllerDelegate {
func pinLockSetupControllerDidComplete(_ controller: PinLockSetupController) {
SPTracker.trackSettingsPinlockEnabled(true)
dismissPresentedViewController()
SPPinLockManager.shared.shouldUseBiometry = biometrySwitch.isOn
}

func pinLockSetupControllerDidCancel(_ controller: PinLockSetupController) {
Expand Down
3 changes: 2 additions & 1 deletion Simplenote/Classes/SPSettingsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#import "SPTableViewController.h"

@interface SPSettingsViewController : SPTableViewController <UIPickerViewDelegate, UIPickerViewDataSource> {

//Preferences
NSNumber *sortOrderPref;
NSNumber *numPreviewLinesPref;
}

@property (nonatomic, strong) UISwitch *biometrySwitch;

@end

extern NSString *const SPAlphabeticalTagSortPref;
Expand Down
5 changes: 2 additions & 3 deletions Simplenote/Classes/SPSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@interface SPSettingsViewController ()
@property (nonatomic, strong) UISwitch *condensedNoteListSwitch;
@property (nonatomic, strong) UISwitch *alphabeticalTagSortSwitch;
@property (nonatomic, strong) UISwitch *biometrySwitch;
@property (nonatomic, strong) UISwitch *sustainerIconSwitch;
@property (nonatomic, strong) UITextField *pinTimeoutTextField;
@property (nonatomic, strong) UIPickerView *pinTimeoutPickerView;
Expand Down Expand Up @@ -747,11 +746,11 @@ - (void)tagSortSwitchDidChangeValue:(UISwitch *)sender

- (void)touchIdSwitchDidChangeValue:(UISwitch *)sender
{
SPPinLockManager.shared.shouldUseBiometry = sender.on;

if (![self isPinLockEnabled] && [self.biometrySwitch isOn]) {
UIAlertController* alert = [self pinLockRequiredAlert];
[self presentViewController:alert animated:YES completion:nil];
} else {
SPPinLockManager.shared.shouldUseBiometry = sender.on;
}
}

Expand Down

0 comments on commit 14904c8

Please sign in to comment.