Always show "Reconnect" button (#278)
Will do nothing if VPN is disabled. Suboptimal, but consistent with Mac menu.
This commit is contained in:
parent
6fd1f96e54
commit
7f9ae7c3bc
|
@ -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
|
||||||
|
|
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue