diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-08-07 17:08:35 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-08-14 08:41:17 -0300 |
| commit | b600d4b9b409491dd24d044d214b592d755608e6 (patch) | |
| tree | b16b51ca760c00eaa81c8903690060e331cfa9c4 /app/containers | |
| parent | 8bfbdd501489b1163b6c7e8a2b8de823b5ab0e63 (diff) | |
| download | mullvadvpn-b600d4b9b409491dd24d044d214b592d755608e6.tar.xz mullvadvpn-b600d4b9b409491dd24d044d214b592d755608e6.zip | |
Implement IPv6 enable/disable in GUI
Diffstat (limited to 'app/containers')
| -rw-r--r-- | app/containers/AdvancedSettingsPage.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/containers/AdvancedSettingsPage.js b/app/containers/AdvancedSettingsPage.js index bf584096b9..ce935a89e4 100644 --- a/app/containers/AdvancedSettingsPage.js +++ b/app/containers/AdvancedSettingsPage.js @@ -8,10 +8,16 @@ import RelaySettingsBuilder from '../lib/relay-settings-builder'; import { log } from '../lib/platform'; import type { ReduxState, ReduxDispatch } from '../redux/store'; +import type { RelaySettingsRedux } from '../redux/settings/reducers'; import type { SharedRouteProps } from '../routes'; const mapStateToProps = (state: ReduxState) => { - const relaySettings = state.settings.relaySettings; + const protocolAndPort = mapRelaySettingsToProtocolAndPort(state.settings.relaySettings); + + return { enableIpv6: state.settings.enableIpv6, ...protocolAndPort }; +}; + +const mapRelaySettingsToProtocolAndPort = (relaySettings: RelaySettingsRedux) => { if (relaySettings.normal) { const { protocol, port } = relaySettings.normal; return { @@ -55,6 +61,14 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => log.error('Failed to update relay settings', e.message); } }, + + setEnableIpv6: async (enableIpv6) => { + try { + await props.app.setEnableIpv6(enableIpv6); + } catch (e) { + log.error('Failed to update enable IPv6', e.message); + } + }, }; }; |
