Commit Graph

25 Commits

Author SHA1 Message Date
Davide De Rosa d7ebcb23ba
Split views into extensions (#321)
Nothing but moving code around to reorganize views into the following
sections (MARK):

- Properties/Body
- Subviews
- Actions
2023-07-03 16:54:43 +02:00
Davide De Rosa b4ad8dea0d Do some code clean up
- Use guard in validators

- Rename URL.openURL() to URL.open()

- Sort imports (SwiftLint)

- Drop unused VPNProtocolType.allTypes

- Drop unused imports
2023-05-21 11:48:03 +02:00
Davide De Rosa f06f097f27
Add SwiftLint phase (#262) 2023-03-17 21:55:47 +01:00
Davide De Rosa 37354d1b87 Update copyright 2023-03-17 16:56:19 +01:00
Davide De Rosa 2e10aab039
Extend authentication methods (#259)
* Add profile authentication method

- Persistent (default, fallback)

- Interactive (may expire through reconnections)

- TOTP (seed-based) - currently disabled

* Disable on-demand if login is interactive

* Present interactive prompt on VPN toggle
2023-03-17 16:49:35 +01:00
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 d10edc69fe Restore truncated VPN footer workaround 2022-08-19 08:34:55 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00
Davide De Rosa 02213a7c50 Drop truncation hack 2022-05-23 10:10:02 +02:00
Davide De Rosa a2d4ed370e Revisit sidebar with per-profile VPN toggles 2022-05-21 19:15:37 +02:00
Davide De Rosa 93abaf538b Simplify redundant parts of ProfileManager
- Drop overthought activeHeader

- Drop willUpdateCurrentProfile, use observable

- Drop willUpdateActiveId, observe value publisher
2022-05-03 14:36:55 +02:00
Davide De Rosa 48d499569b Use block versions of Section header/footer 2022-05-01 19:48:24 +02:00
Davide De Rosa cfc0d4f572 Restore active profile on top
Flashing on activation was caused by VPNManager.disable() in
ProfileView+VPN, because by setting lastError to nil it would
notify a change to ProfileRow (via VPNStateView) during the
profile row activation animation. That caused the flicker.

Instead, disable VPN first, then start the animation.

Anyway, avoid clearing a nil lastError.
2022-05-01 19:19:43 +02:00
Davide De Rosa 1ff19b331f Move VPNToggle to standalone view 2022-04-26 10:40:46 +02:00
Davide De Rosa ccde6a30cf Fix issues with VPN toggle
- Move rate limit to UI only

- Keep caption constant to "Enabled"
2022-04-25 23:12:45 +02:00
Davide De Rosa efb9760d6b Redo VPN toggle properly
- Use local @State for appearance

- On binding set, control VPNManager
2022-04-25 16:36:07 +02:00
Davide De Rosa 6434008ebd Make destructive buttons standalone
- Uninstall VPN

- Remove profile (add to ProfileView)

Create DestructiveButton with iOS 15 .role when available.
2022-04-25 16:34:22 +02:00
Davide De Rosa 6aee88e69a Refactor theme styles
- Hide colors behind styles

- Add "Style" suffix
2022-04-23 11:48:43 +02:00
Davide De Rosa ad1539023e Split VPN status and data count 2022-04-23 10:25:31 +02:00
Davide De Rosa 2432f0d97a Rewrite ProfileView as a view of currentProfile
Do not load profile in View, instead:

- Load active profile on app launch

- Load selected profile on organizer selection
2022-04-23 10:25:31 +02:00
Davide De Rosa d8e47cb7c0 Refactor strings and add new ones
- Move Localizable.strings above to share *.lproj folders

- Reorg menus into contextual/system

- Shorten titles of contextual menus

- Update sharing message with WireGuard

- Drop AlternativeTo

7 phrases left to translate into 9 languages.
2022-04-22 13:12:42 +02:00
Davide De Rosa 322bdf2993 Serialize active profile immediately
Otherwise:

- Switch from former active profile A to B
- Connect to now active profile B
- Kill app
- Reopen app
- App shows connected to profile A

Because active profile was not saved immediately on switch.

Unnecessary now to also save it on background persist().
2022-04-22 10:05:28 +02:00
Davide De Rosa 7095791428 Extend styles for VPN status description 2022-04-22 09:57:13 +02:00
Davide De Rosa 46050e0141 Refactor ProfileView a little bit
- Make welcome a computed property

- Reuse first header for consistency when loading

- Convert isDeleted to better isExisting (inverted)
2022-04-21 19:11:22 +02:00
Davide De Rosa bf65f76401 Merge project into iOS + macOS
Share views with both platforms initially. Will split specific
views step by step.
2022-04-19 16:14:23 +02:00