diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-02-28 16:15:07 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-04-06 10:37:05 +0200 |
| commit | 43294fbf8bead7f2bb28a84e8ff6fddc7100ec23 (patch) | |
| tree | 7d5ca2e2f3d0cfcd30b2f11bb0eaa4ef7dda9cd3 /gui/src/renderer/containers | |
| parent | 808d2f753c64da3a3e5f49bb0fdf52767faa2e30 (diff) | |
| download | mullvadvpn-43294fbf8bead7f2bb28a84e8ff6fddc7100ec23.tar.xz mullvadvpn-43294fbf8bead7f2bb28a84e8ff6fddc7100ec23.zip | |
Make welcome screen disappear after adding time to account
Diffstat (limited to 'gui/src/renderer/containers')
| -rw-r--r-- | gui/src/renderer/containers/NewAccountViewContainer.tsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gui/src/renderer/containers/NewAccountViewContainer.tsx b/gui/src/renderer/containers/NewAccountViewContainer.tsx new file mode 100644 index 0000000000..a174874d48 --- /dev/null +++ b/gui/src/renderer/containers/NewAccountViewContainer.tsx @@ -0,0 +1,26 @@ +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; +import AccountExpiry from '../../shared/account-expiry'; +import NewAccountView from '../components/NewAccountView'; +import accountActions from '../redux/account/actions'; + +import withAppContext, { IAppContext } from '../context'; +import { IReduxState, ReduxDispatch } from '../redux/store'; + +const mapStateToProps = (state: IReduxState) => ({ + accountToken: state.account.accountToken, + accountExpiry: state.account.expiry + ? new AccountExpiry(state.account.expiry, state.userInterface.locale) + : undefined, + isOffline: state.connection.isBlocked, +}); +const mapDispatchToProps = (dispatch: ReduxDispatch, props: IAppContext) => { + const account = bindActionCreators(accountActions, dispatch); + return { + // Changes login method from "new_account" to "existing_account" + hideWelcomeView: () => account.loggedIn(), + onExternalLinkWithAuth: (url: string) => props.app.openLinkWithAuth(url), + }; +}; + +export default withAppContext(connect(mapStateToProps, mapDispatchToProps)(NewAccountView)); |
