Do not open long content when XOR is disabled
This commit is contained in:
parent
37354d1b87
commit
8f999a462e
|
@ -141,13 +141,16 @@ extension EndpointAdvancedView.OpenVPNView {
|
|||
Text(L10n.Endpoint.Advanced.Openvpn.Items.Digest.caption)
|
||||
.withTrailingText($0.localizedDescription)
|
||||
}
|
||||
// Text(Unlocalized.VPN.xor)
|
||||
// .withTrailingText(settings.xor.localizedDescription)
|
||||
if let xor = settings.xor {
|
||||
themeLongContentLink(
|
||||
Unlocalized.VPN.xor,
|
||||
content: .constant(settings.xor.localizedLongDescription),
|
||||
withPreview: settings.xor.localizedDescription
|
||||
content: .constant(xor.localizedLongDescription),
|
||||
withPreview: xor.localizedDescription
|
||||
)
|
||||
} else {
|
||||
Text(Unlocalized.VPN.xor)
|
||||
.withTrailingText(L10n.Global.Strings.disabled)
|
||||
}
|
||||
} header: {
|
||||
Text(L10n.Endpoint.Advanced.Openvpn.Sections.Communication.header)
|
||||
}
|
||||
|
@ -168,13 +171,16 @@ extension EndpointAdvancedView.OpenVPNView {
|
|||
values: OpenVPN.Digest.available,
|
||||
description: \.localizedDescription
|
||||
)
|
||||
// Text(Unlocalized.VPN.xor)
|
||||
// .withTrailingText(builder.xorMethod.localizedDescription)
|
||||
if let xor = builder.xorMethod {
|
||||
themeLongContentLink(
|
||||
Unlocalized.VPN.xor,
|
||||
content: .constant(builder.xorMethod.localizedLongDescription),
|
||||
withPreview: builder.xorMethod.localizedDescription
|
||||
content: .constant(xor.localizedLongDescription),
|
||||
withPreview: xor.localizedDescription
|
||||
)
|
||||
} else {
|
||||
Text(Unlocalized.VPN.xor)
|
||||
.withTrailingText(L10n.Global.Strings.disabled)
|
||||
}
|
||||
} header: {
|
||||
Text(L10n.Endpoint.Advanced.Openvpn.Sections.Communication.header)
|
||||
}
|
||||
|
|
|
@ -85,11 +85,8 @@ extension Optional where Wrapped == OpenVPN.TLSWrap {
|
|||
}
|
||||
}
|
||||
|
||||
extension Optional where Wrapped == OpenVPN.XORMethod {
|
||||
extension OpenVPN.XORMethod {
|
||||
var localizedDescription: String {
|
||||
guard let self = self else {
|
||||
return L10n.Global.Strings.disabled
|
||||
}
|
||||
switch self {
|
||||
case .xormask:
|
||||
return Unlocalized.OpenVPN.XOR.xormask.rawValue
|
||||
|
|
Loading…
Reference in New Issue