diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-08-07 11:03:11 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-08-07 11:03:11 +0200 |
| commit | 858ded2aa27ab9c86ecf79c1702ef07a2bdf60fe (patch) | |
| tree | c279d261fad33222c3fb7e0c45904b2915f21f1b /app/components/Connect.js | |
| parent | 83ae95e38026c16703a50a78966d583280010f3d (diff) | |
| parent | 7ca1a8e1a3eecd18ee4acea2007b22092da97fd9 (diff) | |
| download | mullvadvpn-858ded2aa27ab9c86ecf79c1702ef07a2bdf60fe.tar.xz mullvadvpn-858ded2aa27ab9c86ecf79c1702ef07a2bdf60fe.zip | |
Merge branch 'update-flow-v0.78'
Diffstat (limited to 'app/components/Connect.js')
| -rw-r--r-- | app/components/Connect.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js index d472c45b31..037ab02495 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -80,8 +80,18 @@ export default class Connect extends Component<ConnectProps, ConnectState> { } renderError(error: Error) { - const title = error.userFriendlyTitle || 'Something went wrong'; - const message = error.userFriendlyMessage || error.message; + let title = ''; + let message = ''; + + if (error instanceof NoCreditError) { + title = 'Out of time'; + message = 'Buy more time, so you can continue using the internet securely'; + } + + if (error instanceof NoInternetError) { + title = 'Offline'; + message = 'Your internet connection will be secured when you get back online'; + } return ( <View style={styles.connect}> @@ -91,7 +101,7 @@ export default class Connect extends Component<ConnectProps, ConnectState> { <View style={styles.status}> <View style={styles.error_title}>{title}</View> <View style={styles.error_message}>{message}</View> - {error.type === 'NO_CREDIT' ? ( + {error instanceof NoCreditError ? ( <View> <AppButton.GreenButton onPress={this.onExternalLink.bind(this, 'purchase')}> <AppButton.Label>Buy more time</AppButton.Label> |
