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/components | |
| 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/components')
| -rw-r--r-- | gui/src/renderer/components/Connect.tsx | 9 | ||||
| -rw-r--r-- | gui/src/renderer/components/NewAccountView.tsx | 9 |
2 files changed, 11 insertions, 7 deletions
diff --git a/gui/src/renderer/components/Connect.tsx b/gui/src/renderer/components/Connect.tsx index 7a6ba17739..c994f4f42f 100644 --- a/gui/src/renderer/components/Connect.tsx +++ b/gui/src/renderer/components/Connect.tsx @@ -3,6 +3,7 @@ import { Component, Styles, View } from 'reactxp'; import { links } from '../../config.json'; import AccountExpiry from '../../shared/account-expiry'; import { AccountToken } from '../../shared/daemon-rpc-types'; +import NewAccountViewContainer from '../containers/NewAccountViewContainer'; import NotificationAreaContainer from '../containers/NotificationAreaContainer'; import { AuthFailureKind, parseAuthFailure } from '../lib/auth-failure'; import { LoginState } from '../redux/account/reducers'; @@ -15,7 +16,6 @@ import { Container, Header, Layout } from './Layout'; import Map, { MarkerStyle, ZoomLevel } from './Map'; import { ModalContainer } from './Modal'; import TunnelControl from './TunnelControl'; -import NewAccountView from './NewAccountView'; interface IProps { connection: IConnectionReduxState; @@ -143,12 +143,7 @@ export default class Connect extends Component<IProps, IState> { private renderContent() { if (this.props.loginState.type === 'ok' && this.props.loginState.method === 'new_account') { - return ( - <NewAccountView - accountToken={this.props.accountToken} - onExternalLinkWithAuth={this.props.onExternalLinkWithAuth} - /> - ); + return <NewAccountViewContainer />; } else if (this.state.isAccountExpired) { return ( <ExpiredAccountErrorView diff --git a/gui/src/renderer/components/NewAccountView.tsx b/gui/src/renderer/components/NewAccountView.tsx index e6319a3d0e..a4a51191fb 100644 --- a/gui/src/renderer/components/NewAccountView.tsx +++ b/gui/src/renderer/components/NewAccountView.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { Component, Text, View } from 'reactxp'; import { links } from '../../config.json'; +import AccountExpiry from '../../shared/account-expiry'; import { AccountToken } from '../../shared/daemon-rpc-types'; import { messages } from '../../shared/gettext'; import styles from './NewAccountViewStyles'; @@ -9,10 +10,18 @@ import * as AppButton from './AppButton'; interface INewAccountViewProps { accountToken?: AccountToken; + accountExpiry?: AccountExpiry; + hideWelcomeView: () => void; onExternalLinkWithAuth: (url: string) => Promise<void>; } export default class NewAccountView extends Component<INewAccountViewProps> { + public componentDidUpdate() { + if (this.props.accountExpiry && !this.props.accountExpiry.hasExpired()) { + this.props.hideWelcomeView(); + } + } + public render() { return ( <View style={styles.container}> |
