diff options
Diffstat (limited to 'app/containers')
| -rw-r--r-- | app/containers/AccountPage.js | 4 | ||||
| -rw-r--r-- | app/containers/ConnectPage.js | 4 | ||||
| -rw-r--r-- | app/containers/LoginPage.js | 6 | ||||
| -rw-r--r-- | app/containers/SettingsPage.js | 8 |
4 files changed, 14 insertions, 8 deletions
diff --git a/app/containers/AccountPage.js b/app/containers/AccountPage.js index f5d31e5bc0..ae992bc12a 100644 --- a/app/containers/AccountPage.js +++ b/app/containers/AccountPage.js @@ -5,8 +5,8 @@ import { bindActionCreators } from 'redux'; import { push } from 'react-router-redux'; import Account from '../components/Account'; import accountActions from '../redux/account/actions'; -import { shell } from 'electron'; import { links } from '../config'; +import Linking from '../lib/linking'; 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: () => shell.openExternal(links['purchase']) + onBuyMore: () => Linking(links['purchase']) }; }; diff --git a/app/containers/ConnectPage.js b/app/containers/ConnectPage.js index ca64c6725a..1694e84556 100644 --- a/app/containers/ConnectPage.js +++ b/app/containers/ConnectPage.js @@ -3,10 +3,10 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { push } from 'react-router-redux'; -import { shell } from 'electron'; import { links } from '../config'; import Connect from '../components/Connect'; import connectActions from '../redux/connection/actions'; +import Linking from '../lib/linking'; import type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => onDisconnect: () => { disconnect(backend); }, - onExternalLink: (type) => shell.openExternal(links[type]), + onExternalLink: (type) => Linking(links[type]), getServerInfo: (relayLocation) => backend.serverInfo(relayLocation), }; }; diff --git a/app/containers/LoginPage.js b/app/containers/LoginPage.js index c6c7d3a7e2..16703fdc0c 100644 --- a/app/containers/LoginPage.js +++ b/app/containers/LoginPage.js @@ -1,12 +1,16 @@ +<<<<<<< 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 type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -26,7 +30,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => onFirstChangeAfterFailure: () => { resetLoginError(); }, - onExternalLink: (type) => shell.openExternal(links[type]), + onExternalLink: (type) => Linking(links[type]), onAccountTokenChange: (token) => { updateAccountToken(token); }, diff --git a/app/containers/SettingsPage.js b/app/containers/SettingsPage.js index dcd1d121bb..8d41efd4d9 100644 --- a/app/containers/SettingsPage.js +++ b/app/containers/SettingsPage.js @@ -4,8 +4,10 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { push } from 'react-router-redux'; import Settings from '../components/Settings'; -import { remote, shell } from 'electron'; +import settingsActions from '../redux/settings/actions'; import { links } from '../config'; +import Linking from '../lib/linking'; +import Exit from '../lib/exit'; import type { ReduxState, ReduxDispatch } from '../redux/store'; import type { SharedRouteProps } from '../routes'; @@ -14,12 +16,12 @@ const mapStateToProps = (state: ReduxState) => state; const mapDispatchToProps = (dispatch: ReduxDispatch, _props: SharedRouteProps) => { const { push: pushHistory } = bindActionCreators({ push }, dispatch); return { - onQuit: () => remote.app.quit(), + onQuit: () => Exit(), onClose: () => pushHistory('/connect'), onViewAccount: () => pushHistory('/settings/account'), onViewSupport: () => pushHistory('/settings/support'), onViewAdvancedSettings: () => pushHistory('/settings/advanced'), - onExternalLink: (type) => shell.openExternal(links[type]), + onExternalLink: (type) => Linking(links[type]), }; }; |
