File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,19 @@ class AppExpirationAlerter {
19
19
static func alertIfNeeded( viewControllerToPresentFrom: UIViewController ) {
20
20
21
21
let now = Date ( )
22
-
23
- guard let profileExpiration = BuildDetails . default. profileExpiration, now > profileExpiration - expirationAlertWindow else {
22
+
23
+ guard let profileExpiration = BuildDetails . default. profileExpiration else {
24
24
return
25
25
}
26
26
27
27
let expirationDate = calculateExpirationDate ( profileExpiration: profileExpiration)
28
28
29
29
let timeUntilExpiration = expirationDate. timeIntervalSince ( now)
30
30
31
+ if timeUntilExpiration > expirationAlertWindow {
32
+ return
33
+ }
34
+
31
35
let minimumTimeBetweenAlerts : TimeInterval = timeUntilExpiration > . hours( 24 ) ? . days( 2 ) : . hours( 1 )
32
36
33
37
if let lastAlertDate = UserDefaults . appGroup? . lastProfileExpirationAlertDate {
You can’t perform that action at this time.
0 commit comments