summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2019-08-08 00:06:11 +0200
committerLinus Färnstrand <linus@mullvad.net>2019-08-08 00:28:26 +0200
commit04f93ed18b516809b1f3228a07e6c1e9d5c9dea9 (patch)
tree096febbb5dbad1c5d59f4eb17305fb8330671fdc
parent596c9c8ea89f1d8e36caa3c87a880d13af1caaea (diff)
downloadmullvadvpn-04f93ed18b516809b1f3228a07e6c1e9d5c9dea9.tar.xz
mullvadvpn-04f93ed18b516809b1f3228a07e6c1e9d5c9dea9.zip
Only show OpenVPN constraints when OpenVPN is active
-rw-r--r--gui/src/renderer/components/AdvancedSettings.tsx62
1 files changed, 35 insertions, 27 deletions
diff --git a/gui/src/renderer/components/AdvancedSettings.tsx b/gui/src/renderer/components/AdvancedSettings.tsx
index 48881cfe89..2745fbf1a2 100644
--- a/gui/src/renderer/components/AdvancedSettings.tsx
+++ b/gui/src/renderer/components/AdvancedSettings.tsx
@@ -232,36 +232,44 @@ export default class AdvancedSettings extends Component<IProps, IState> {
undefined
)}
- <View style={styles.advanced_settings__content}>
- <Selector
- title={messages.pgettext(
- 'advanced-settings-view',
- 'OpenVPN transport protocol',
- )}
- values={this.protocolItems}
- value={this.props.openvpn.protocol}
- onSelect={this.onSelectOpenvpnProtocol}
- />
-
- {this.props.openvpn.protocol ? (
+ {this.props.tunnelProtocol !== 'wireguard' ? (
+ <View style={styles.advanced_settings__content}>
<Selector
- title={sprintf(
- // TRANSLATORS: The title for the port selector section.
- // TRANSLATORS: Available placeholders:
- // TRANSLATORS: %(portType)s - a selected protocol (either TCP or UDP)
- messages.pgettext('advanced-settings-view', 'OpenVPN %(portType)s port'),
- {
- portType: this.props.openvpn.protocol.toUpperCase(),
- },
+ title={messages.pgettext(
+ 'advanced-settings-view',
+ 'OpenVPN transport protocol',
)}
- values={this.portItems[this.props.openvpn.protocol]}
- value={this.props.openvpn.port}
- onSelect={this.onSelectOpenVpnPort}
+ values={this.protocolItems}
+ value={this.props.openvpn.protocol}
+ onSelect={this.onSelectOpenvpnProtocol}
/>
- ) : (
- undefined
- )}
- </View>
+
+ {this.props.openvpn.protocol ? (
+ <Selector
+ title={sprintf(
+ // TRANSLATORS: The title for the port selector section.
+ // TRANSLATORS: Available placeholders:
+ // TRANSLATORS: %(portType)s - a selected protocol (either TCP or UDP)
+ messages.pgettext(
+ 'advanced-settings-view',
+ 'OpenVPN %(portType)s port',
+ ),
+ {
+ portType: this.props.openvpn.protocol.toUpperCase(),
+ },
+ )}
+ values={this.portItems[this.props.openvpn.protocol]}
+ value={this.props.openvpn.port}
+ onSelect={this.onSelectOpenVpnPort}
+ />
+ ) : (
+ undefined
+ )}
+ </View>
+ ) : (
+ undefined
+ )}
+
{this.props.tunnelProtocol === 'wireguard' && process.platform !== 'win32' ? (
<View style={styles.advanced_settings__content}>
<Selector