Always show "Reconnect" button (#278)

Will do nothing if VPN is disabled. Suboptimal, but consistent
with Mac menu.
This commit is contained in:
Davide De Rosa 2023-04-01 22:46:12 +02:00 committed by GitHub
parent 6fd1f96e54
commit 7f9ae7c3bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 16 deletions

View File

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Bump targets to iOS 15 / macOS 12. - Bump targets to iOS 15 / macOS 12.
- Always show "Reconnect" button. [#277](https://github.com/passepartoutvpn/passepartout-apple/pull/277)
- Move Diagnostics view to Profile bottom. [#261](https://github.com/passepartoutvpn/passepartout-apple/pull/261) - Move Diagnostics view to Profile bottom. [#261](https://github.com/passepartoutvpn/passepartout-apple/pull/261)
### Fixed ### Fixed

View File

@ -148,19 +148,11 @@ extension OrganizerView {
} }
var body: some View { var body: some View {
// XXX: iOS bug, before 16, context menu is not redrawn on VPN state change
if #available(iOS 16, *), isActiveProfileNotDisconnected {
reconnectButton reconnectButton
}
duplicateButton duplicateButton
deleteButton deleteButton
} }
private var isActiveProfileNotDisconnected: Bool {
profileManager.isActiveProfile(header.id) && currentVPNState.vpnStatus != .disconnected
}
private var reconnectButton: some View { private var reconnectButton: some View {
ProfileView.ReconnectButton() ProfileView.ReconnectButton()
} }

View File

@ -93,9 +93,7 @@ extension ProfileView {
private var mainView: some View { private var mainView: some View {
Menu { Menu {
if isActiveProfileNotDisconnected {
ReconnectButton() ReconnectButton()
}
ShortcutsButton( ShortcutsButton(
modalType: $modalType modalType: $modalType
) )
@ -115,10 +113,6 @@ extension ProfileView {
} }
} }
private var isActiveProfileNotDisconnected: Bool {
profileManager.isActiveProfile(header.id) && currentVPNState.vpnStatus != .disconnected
}
private var uninstallVPNButton: some View { private var uninstallVPNButton: some View {
Button { Button {
actionSheetType = .uninstallVPN actionSheetType = .uninstallVPN