Skip to content

Commit 652d6b7

Browse files
committed
Fixed setting date in the past disabling the lock
1 parent 2ed8498 commit 652d6b7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 3.8.5
2+
* Fixed the lock being sometimes disabled when setting the date in the past (Closed [#174](https://github.com/rolandleth/LTHPasscodeViewController/issues/174)).
3+
14
# 3.8.4
25
* Fixed not being able to show the keyboard again after dismissing it on iPad (Closed [#171](https://github.com/rolandleth/LTHPasscodeViewController/issues/171)).
36

LTHPasscodeViewController/LTHPasscodeViewController.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,12 @@ - (BOOL)_didPasscodeTimerEnd {
253253
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
254254
// startTime wasn't saved yet (first app use and it crashed, phone force
255255
// closed, etc) if it returns -1.
256-
return now - [self _timerStartTime] >= [self _timerDuration] ||
257-
[self _timerStartTime] == -1;
256+
return now - [self _timerStartTime] >= [self _timerDuration]
257+
|| [self _timerStartTime] == -1
258+
|| now <= [self _timerStartTime];
259+
// If the date was set in the past, this would return false.
260+
// It won't register as false, even right as it is being enabled,
261+
// because the saving alone takes 0.002+ seconds on a MBP 2.6GHz i7.
258262
}
259263

260264

0 commit comments

Comments
 (0)