Commit Graph

10 Commits

Author SHA1 Message Date
Davide De Rosa 4c4b3ee0c9 Revert to concrete-only managers
Abstraction was overcomplicated. Strategy pattern is enough.
2022-09-03 12:47:40 +02:00
Davide De Rosa 1c64253a1f Fix inverted profile lastUpdate logic
- Least recent was set last in the headers dictionary, thus
overwriting most recent (ascending = false)

- Mapping full profiles directly to array was generating
duplicates, use a dictionary to keep ID unicity
2022-08-04 23:36:09 +02:00
Davide De Rosa b183dece8c Fix logic to activate first created profile
Broken in dec7fb9030

VPN was lost when app was sent to background. Current (and active)
profile was persisted with nil isActive and instead of ignoring
profile activation, isActive was falling back to
allHeaders.isEmpty (false), erroneously deactivating the profile
and disconnecting the VPN.
2022-08-04 23:33:17 +02:00
Davide De Rosa dec7fb9030 Activate first created profile 2022-07-16 17:39:42 +02:00
Davide De Rosa 58e375ec41 Attach @MainActor where needed
Some methods were updating UI from non-main thread.
2022-07-16 17:39:42 +02:00
Davide De Rosa 7d5f3e63c8 Add 'didUpdate' subjects in managers
objectWillChange may not work outside SwiftUI.

- ProfileManager.didUpdateProfiles

- ProviderManager.didUpdateProviders
2022-07-15 08:59:29 +02:00
Davide De Rosa 7771b50b56 Add ProfileManager methods to return full profiles 2022-07-14 17:07:30 +02:00
Davide De Rosa 9d9dc2b2f6 Rename activeProfileId publisher for consistency 2022-07-14 17:07:30 +02:00
Davide De Rosa cbf00cef73 Fix Core Data fault due to missing headers lastUpdate 2022-07-14 17:07:30 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00