diff options
| author | anderklander <anderklander@gmail.com> | 2017-11-14 18:50:21 +0100 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-12-14 09:16:50 +0100 |
| commit | ed657f7892eb9263e15a0cf2ffb0caa60b32491c (patch) | |
| tree | 789a9dcdf150b7e5f9df098c2d1ae3a7680255ad /app/containers | |
| parent | 7c3d84ac86a5a29cbb456dbdce2f7af9696021cf (diff) | |
| download | mullvadvpn-ed657f7892eb9263e15a0cf2ffb0caa60b32491c.tar.xz mullvadvpn-ed657f7892eb9263e15a0cf2ffb0caa60b32491c.zip | |
Links/exit in platform.js
moved separate small files to platform.js to handle platform specific tasks
Diffstat (limited to 'app/containers')
| -rw-r--r-- | app/containers/AccountPage.js | 4 | ||||
| -rw-r--r-- | app/containers/ConnectPage.js | 5 | ||||
| -rw-r--r-- | app/containers/LoginPage.js | 8 | ||||
| -rw-r--r-- | app/containers/SettingsPage.js | 9 |
4 files changed, 10 insertions, 16 deletions
diff --git a/app/containers/AccountPage.js b/app/containers/AccountPage.js index ae992bc12a..4ef7de5d83 100644 --- a/app/containers/AccountPage.js +++ b/app/containers/AccountPage.js @@ -6,7 +6,7 @@ import { push } from 'react-router-redux'; import Account from '../components/Account'; import accountActions from '../redux/account/actions'; import { links } from '../config'; -import Linking from '../lib/linking'; +import { open } from '../lib/platform'; import type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -22,7 +22,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => onClose: () => { pushHistory('/settings'); }, - onBuyMore: () => Linking(links['purchase']) + onBuyMore: () => open(links['purchase']) }; }; diff --git a/app/containers/ConnectPage.js b/app/containers/ConnectPage.js index 1694e84556..6db84a7680 100644 --- a/app/containers/ConnectPage.js +++ b/app/containers/ConnectPage.js @@ -6,7 +6,7 @@ import { push } from 'react-router-redux'; import { links } from '../config'; import Connect from '../components/Connect'; import connectActions from '../redux/connection/actions'; -import Linking from '../lib/linking'; +import { open } from '../lib/platform'; import type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -25,6 +25,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => const { backend } = props; return { +<<<<<<< HEAD onSettings: () => { pushHistory('/settings'); }, @@ -40,7 +41,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => onDisconnect: () => { disconnect(backend); }, - onExternalLink: (type) => Linking(links[type]), + onExternalLink: (type) => open(links[type]), getServerInfo: (relayLocation) => backend.serverInfo(relayLocation), }; }; diff --git a/app/containers/LoginPage.js b/app/containers/LoginPage.js index 16703fdc0c..bf1a7fdc70 100644 --- a/app/containers/LoginPage.js +++ b/app/containers/LoginPage.js @@ -1,16 +1,12 @@ -<<<<<<< HEAD // @flow -import { shell } from 'electron'; -======= ->>>>>>> Reactxp starter pack import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { push } from 'react-router-redux'; import Login from '../components/Login'; import accountActions from '../redux/account/actions'; import { links } from '../config'; -import Linking from '../lib/linking'; +import { open } from '../lib/platform'; import type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -30,7 +26,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => onFirstChangeAfterFailure: () => { resetLoginError(); }, - onExternalLink: (type) => Linking(links[type]), + onExternalLink: (type) => open(links[type]), onAccountTokenChange: (token) => { updateAccountToken(token); }, diff --git a/app/containers/SettingsPage.js b/app/containers/SettingsPage.js index 8d41efd4d9..351c819b40 100644 --- a/app/containers/SettingsPage.js +++ b/app/containers/SettingsPage.js @@ -1,13 +1,10 @@ // @flow import { connect } from 'react-redux'; -import { bindActionCreators } from 'redux'; import { push } from 'react-router-redux'; import Settings from '../components/Settings'; -import settingsActions from '../redux/settings/actions'; import { links } from '../config'; -import Linking from '../lib/linking'; -import Exit from '../lib/exit'; +import { open, exit } from '../lib/platform'; import type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -16,12 +13,12 @@ const mapStateToProps = (state: ReduxState) => state; const mapDispatchToProps = (dispatch: ReduxDispatch, _props: SharedRouteProps) => { const { push: pushHistory } = bindActionCreators({ push }, dispatch); return { - onQuit: () => Exit(), + onQuit: () => exit(), onClose: () => pushHistory('/connect'), onViewAccount: () => pushHistory('/settings/account'), onViewSupport: () => pushHistory('/settings/support'), onViewAdvancedSettings: () => pushHistory('/settings/advanced'), - onExternalLink: (type) => Linking(links[type]), + onExternalLink: (type) => open(links[type]), }; }; |
