summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-07-05 09:46:55 +0100
committerEmīls Piņķis <emils@mullvad.net>2019-07-05 16:49:28 +0100
commit4ce55b897d81baab00a16b07a28187ba423fd2e1 (patch)
tree54cc27ace293e0936ab4b9a022bcf1b3dca12ea2
parent8519fb7719b5d0cad0baa3f812845b238fb4c066 (diff)
downloadmullvadvpn-4ce55b897d81baab00a16b07a28187ba423fd2e1.tar.xz
mullvadvpn-4ce55b897d81baab00a16b07a28187ba423fd2e1.zip
Only show WireguardKeysPage on non-windows
-rw-r--r--gui/src/renderer/components/AdvancedSettings.tsx25
-rw-r--r--gui/src/renderer/containers/AdvancedSettingsPage.tsx2
2 files changed, 19 insertions, 8 deletions
diff --git a/gui/src/renderer/components/AdvancedSettings.tsx b/gui/src/renderer/components/AdvancedSettings.tsx
index 34136eb2f4..1805e07bae 100644
--- a/gui/src/renderer/components/AdvancedSettings.tsx
+++ b/gui/src/renderer/components/AdvancedSettings.tsx
@@ -36,6 +36,7 @@ interface IProps {
mssfix?: number;
port?: number;
bridgeState: BridgeState;
+ enableWireguardKeysPage: boolean;
setBridgeState: (value: BridgeState) => void;
setEnableIpv6: (value: boolean) => void;
setBlockWhenDisconnected: (value: boolean) => void;
@@ -256,14 +257,7 @@ export default class AdvancedSettings extends Component<IProps, IState> {
},
)}
</Cell.Footer>
- <View>
- <Cell.CellButton onPress={this.props.onViewWireguardKeys}>
- <Cell.Label>
- {messages.pgettext('advanced-settings-view', 'WireGuard keys')}
- </Cell.Label>
- <Cell.Icon height={12} width={7} source="icon-chevron" />
- </Cell.CellButton>
- </View>
+ {this.wireguardKeysButton()}
</NavigationScrollbars>
</View>
</NavigationContainer>
@@ -273,6 +267,21 @@ export default class AdvancedSettings extends Component<IProps, IState> {
);
}
+ private wireguardKeysButton() {
+ if (this.props.enableWireguardKeysPage) {
+ return (
+ <View>
+ <Cell.CellButton onPress={this.props.onViewWireguardKeys}>
+ <Cell.Label>{messages.pgettext('advanced-settings-view', 'WireGuard keys')}</Cell.Label>
+ <Cell.Icon height={12} width={7} source="icon-chevron" />
+ </Cell.CellButton>
+ </View>
+ );
+ } else {
+ return null;
+ }
+ }
+
private onSelectProtocol = (protocol?: RelayProtocol) => {
this.props.setRelayProtocolAndPort(protocol);
};
diff --git a/gui/src/renderer/containers/AdvancedSettingsPage.tsx b/gui/src/renderer/containers/AdvancedSettingsPage.tsx
index bebcf0464b..4dcb91b6b5 100644
--- a/gui/src/renderer/containers/AdvancedSettingsPage.tsx
+++ b/gui/src/renderer/containers/AdvancedSettingsPage.tsx
@@ -12,12 +12,14 @@ import { ISharedRouteProps } from '../routes';
const mapStateToProps = (state: IReduxState) => {
const protocolAndPort = mapRelaySettingsToProtocolAndPort(state.settings.relaySettings);
+ const enableWireguardKeysPage = process.platform === 'linux' || process.platform === 'darwin';
return {
enableIpv6: state.settings.enableIpv6,
blockWhenDisconnected: state.settings.blockWhenDisconnected,
mssfix: state.settings.openVpn.mssfix,
bridgeState: state.settings.bridgeState,
+ enableWireguardKeysPage,
...protocolAndPort,
};
};