Skip to content

Commit 211a337

Browse files
committed
fix for modal alert
1 parent 874c393 commit 211a337

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Loop/Managers/AppExpirationAlerter.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@ class AppExpirationAlerter {
1919
static func alertIfNeeded(viewControllerToPresentFrom: UIViewController) {
2020

2121
let now = Date()
22-
23-
guard let profileExpiration = BuildDetails.default.profileExpiration, now > profileExpiration - expirationAlertWindow else {
22+
23+
guard let profileExpiration = BuildDetails.default.profileExpiration else {
2424
return
2525
}
2626

2727
let expirationDate = calculateExpirationDate(profileExpiration: profileExpiration)
2828

2929
let timeUntilExpiration = expirationDate.timeIntervalSince(now)
3030

31+
if timeUntilExpiration > expirationAlertWindow {
32+
return
33+
}
34+
3135
let minimumTimeBetweenAlerts: TimeInterval = timeUntilExpiration > .hours(24) ? .days(2) : .hours(1)
3236

3337
if let lastAlertDate = UserDefaults.appGroup?.lastProfileExpirationAlertDate {

0 commit comments

Comments
 (0)