diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/app.js | 6 | ||||
| -rw-r--r-- | app/components/Connect.js | 1 | ||||
| -rw-r--r-- | app/components/Login.js | 14 | ||||
| -rw-r--r-- | app/lib/backend.js | 2 | ||||
| -rw-r--r-- | app/redux/account/reducers.js | 2 |
5 files changed, 13 insertions, 12 deletions
diff --git a/app/app.js b/app/app.js index 1e56830880..f0fa27e4f1 100644 --- a/app/app.js +++ b/app/app.js @@ -24,14 +24,14 @@ const store = configureStore(initialState, memoryHistory); const backend = new Backend(store); // reset login state if user quit the app during login -if((['connecting', 'failed']: Array<LoginState>).includes(store.getState().account.status)) { +if((['logging in', 'failed']: Array<LoginState>).includes(store.getState().account.status)) { store.dispatch(accountActions.loginChange({ status: 'none' })); } -// reset connection state if user quit the app when connecting -if(store.getState().connection.status === 'connecting') { +// reset connection state if user quit the app when logging in +if(store.getState().connection.status === 'logging in') { store.dispatch(connectionActions.connectionChange({ status: 'disconnected' })); diff --git a/app/components/Connect.js b/app/components/Connect.js index edca72c102..173628646d 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -1,4 +1,5 @@ // @flow + import moment from 'moment'; import React, { Component } from 'react'; import { If, Then, Else } from 'react-if'; diff --git a/app/components/Login.js b/app/components/Login.js index 0427832973..e09df8c3c7 100644 --- a/app/components/Login.js +++ b/app/components/Login.js @@ -45,7 +45,7 @@ export default class Login extends Component { formTitle(s: LoginState): string { switch(s) { - case 'connecting': return 'Logging in...'; + case 'logging in': return 'Logging in...'; case 'failed': return 'Login failed'; case 'ok': return 'Login successful'; default: return 'Login'; @@ -55,7 +55,7 @@ export default class Login extends Component { formSubtitle(s: LoginState, e: ?Error): string { switch(s) { case 'failed': return (e && e.message) || 'Unknown error'; - case 'connecting': return 'Checking account number'; + case 'logging in': return 'Checking account number'; default: return 'Enter your account number'; } } @@ -68,7 +68,7 @@ export default class Login extends Component { } switch(s) { - case 'connecting': + case 'logging in': classes.push('login-form__input-wrap--inactive'); break; case 'failed': @@ -83,7 +83,7 @@ export default class Login extends Component { const classes = ['login-footer']; switch(s) { case 'ok': - case 'connecting': + case 'logging in': classes.push('login-footer--invisible'); break; } @@ -97,7 +97,7 @@ export default class Login extends Component { classes.push('login-form__submit--active'); } - if(s === 'connecting') { + if(s === 'logging in') { classes.push('login-form__submit--invisible'); } @@ -122,7 +122,7 @@ export default class Login extends Component { let isFailed = false; let isLoggedIn = false; switch(status) { - case 'connecting': isConnecting = true; break; + case 'logging in': isConnecting = true; break; case 'failed': isFailed = true; break; case 'ok': isLoggedIn = true; break; } @@ -143,7 +143,7 @@ export default class Login extends Component { <Container> <div className="login"> <div className="login-form"> - { /* show spinner when connecting */ } + { /* show spinner when logging in */ } <If condition={ isConnecting }> <Then> <div className="login-form__status-icon"> diff --git a/app/lib/backend.js b/app/lib/backend.js index 9c5b2ed064..6b0e1f100f 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -149,7 +149,7 @@ export class Backend { this._store.dispatch(accountActions.loginChange({ accountNumber: accountNumber, - status: 'connecting', + status: 'logging in', error: null, })); diff --git a/app/redux/account/reducers.js b/app/redux/account/reducers.js index 06dfb05941..52b36f60a0 100644 --- a/app/redux/account/reducers.js +++ b/app/redux/account/reducers.js @@ -6,7 +6,7 @@ import type { Coordinate2d } from '../../types'; import type { ReduxAction } from '../store'; import type { BackendError } from '../../lib/backend'; -export type LoginState = 'none' | 'connecting' | 'failed' | 'ok'; +export type LoginState = 'none' | 'logging in' | 'failed' | 'ok'; export type AccountReduxState = { accountNumber: ?string, paidUntil: ?string, // ISO8601 |
