diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-06-19 19:11:49 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-06-21 16:13:32 +0300 |
| commit | 1137b82c76214f37e7d88ff2e6068705da52e7dc (patch) | |
| tree | 9fe97235c2d92c429a31a79181c94b902393b7e5 /app/components | |
| parent | 5ae8eda0075ec72424c478fdf1ff731db43b0ff5 (diff) | |
| download | mullvadvpn-1137b82c76214f37e7d88ff2e6068705da52e7dc.tar.xz mullvadvpn-1137b82c76214f37e7d88ff2e6068705da52e7dc.zip | |
- Migrate Backend.EventType and Backend.ErrorType to Flow
- Export Backend and BackendError separately
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Connect.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js index 0a3bd761a9..9904012b85 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -6,7 +6,7 @@ import ReactMapboxGl, { Marker } from 'react-mapbox-gl'; import cheapRuler from 'cheap-ruler'; import { Layout, Container, Header } from './Layout'; import { mapbox as mapboxConfig } from '../config'; -import Backend from '../lib/backend'; +import { BackendError } from '../lib/backend'; import ExternalLinkSVG from '../assets/images/icon-extLink.svg'; import type HeaderBarStyle from './HeaderBar'; @@ -55,12 +55,12 @@ export default class Connect extends Component { // this is by far the simplest implementation // later on backend will notify us and disconnect VPN etc.. if(moment(this.props.user.paidUntil).isSameOrBefore(moment())) { - error = new Backend.Error(Backend.ErrorType.noCredit); + error = new BackendError('NO_CREDIT'); } // Offline? if(this.props.connect.isOnline === false) { - error = new Backend.Error(Backend.ErrorType.noInternetConnection); + error = new BackendError('NO_INTERNET'); } return ( @@ -89,7 +89,7 @@ export default class Connect extends Component { <div className="connect__error-message"> { error.message } </div> - <If condition={ error.code === Backend.ErrorType.noCredit }> + <If condition={ error.code === 'NO_CREDIT' }> <Then> <div> <button className="button button--positive" onClick={ this.onExternalLink.bind(this, 'purchase') }> |
