Update restricted profile except expiration (#481)
TV profiles were not updated until expiration.
This commit is contained in:
parent
e3f4443cc0
commit
24b08c4b50
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Restricted profile not updated. [#481](https://github.com/passepartoutvpn/passepartout-apple/pull/481)
|
||||||
|
|
||||||
## 2.3.5 (2024-01-19)
|
## 2.3.5 (2024-01-19)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -149,7 +149,7 @@ private extension AppContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
guard productManager.isEligible(forFeature: .appleTV) else {
|
guard productManager.isEligible(forFeature: .appleTV) else {
|
||||||
var restricted: Profile
|
var restricted = newProfile
|
||||||
let remainingMinutes: Int
|
let remainingMinutes: Int
|
||||||
let expirationDate: Date
|
let expirationDate: Date
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ private extension AppContext {
|
||||||
remainingMinutes = Int(currentExpirationDate.timeIntervalSinceNow / 60.0)
|
remainingMinutes = Int(currentExpirationDate.timeIntervalSinceNow / 60.0)
|
||||||
expirationDate = currentExpirationDate
|
expirationDate = currentExpirationDate
|
||||||
|
|
||||||
restricted = existingProfile
|
restricted.connectionExpirationDate = currentExpirationDate
|
||||||
}
|
}
|
||||||
// otherwise, expire in N minutes from now
|
// otherwise, expire in N minutes from now
|
||||||
else {
|
else {
|
||||||
|
@ -166,7 +166,6 @@ private extension AppContext {
|
||||||
expirationDate = Date()
|
expirationDate = Date()
|
||||||
.addingTimeInterval(TimeInterval(remainingMinutes) * 60.0)
|
.addingTimeInterval(TimeInterval(remainingMinutes) * 60.0)
|
||||||
|
|
||||||
restricted = newProfile
|
|
||||||
restricted.connectionExpirationDate = expirationDate
|
restricted.connectionExpirationDate = expirationDate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue