diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-13 17:12:54 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-13 17:12:54 +0000 |
| commit | e259b37b0d342fe28f8dfecea07db714feecad0e (patch) | |
| tree | e4f34e84fd90f18fa4b3d8bb3b37258abb4bd2e0 /app | |
| parent | 18f8c8bdfa2575242f41dd775b6a51a38f962e1e (diff) | |
| download | mullvadvpn-e259b37b0d342fe28f8dfecea07db714feecad0e.tar.xz mullvadvpn-e259b37b0d342fe28f8dfecea07db714feecad0e.zip | |
Fix linting issues
Diffstat (limited to 'app')
| -rw-r--r-- | app/actions/user.js | 9 | ||||
| -rw-r--r-- | app/components/Login.js | 18 | ||||
| -rw-r--r-- | app/containers/LoginPage.js | 2 | ||||
| -rw-r--r-- | app/lib/backend.js | 4 | ||||
| -rw-r--r-- | app/lib/enum.js | 4 | ||||
| -rw-r--r-- | app/reducers/user.js | 2 |
6 files changed, 18 insertions, 21 deletions
diff --git a/app/actions/user.js b/app/actions/user.js index 90d02bd269..6dababe3e0 100644 --- a/app/actions/user.js +++ b/app/actions/user.js @@ -1,12 +1,11 @@ -import assert from 'assert'; import { createAction } from 'redux-actions'; -import { replace } from 'react-router-redux' +import { replace } from 'react-router-redux'; import { LoginState } from '../constants'; const loginChange = createAction('USER_LOGIN_CHANGE'); const login = (backend, account) => { - return async (dispatch, getState) => { + return async (dispatch) => { try { dispatch(loginChange({ account: account, @@ -28,11 +27,11 @@ const login = (backend, account) => { }; const logout = (backend) => { - return async (dispatch, getState) => { + return async (dispatch) => { try { await backend.logout(); } catch(e) { - console.log(`Failed to log out: ${e.message}`) + console.log(`Failed to log out: ${e.message}`); } // reset login information diff --git a/app/components/Login.js b/app/components/Login.js index 0546163589..47a127c128 100644 --- a/app/components/Login.js +++ b/app/components/Login.js @@ -68,18 +68,18 @@ export default class Login extends Component { formTitle(s) { switch(s) { - case LoginState.connecting: return "Logging in..."; - case LoginState.failed: return "Login failed"; - case LoginState.ok: return "Login successful"; - default: return "Login"; + case LoginState.connecting: return 'Logging in...'; + case LoginState.failed: return 'Login failed'; + case LoginState.ok: return 'Login successful'; + default: return 'Login'; } } formSubtitle(s, e) { switch(s) { - case LoginState.failed: return e.message; - case LoginState.connecting: return 'Checking account number'; - default: return 'Enter your account number'; + case LoginState.failed: return e.message; + case LoginState.connecting: return 'Checking account number'; + default: return 'Enter your account number'; } } @@ -91,8 +91,8 @@ export default class Login extends Component { const isConnecting = status === LoginState.connecting; const isFailed = status === LoginState.failed; const isLoggedIn = status === LoginState.ok; - const inputClass = ["login-form__input-field", isFailed ? "login-form__input-field--error" : ""].join(' '); - const footerClass = ["login-footer", (isConnecting || isLoggedIn) ? "login-footer--invisible" : ""].join(' '); + const inputClass = ['login-form__input-field', isFailed ? 'login-form__input-field--error' : ''].join(' '); + const footerClass = ['login-footer', (isConnecting || isLoggedIn) ? 'login-footer--invisible' : ''].join(' '); const autoFocusRef = input => { if(isFailed && input) { diff --git a/app/containers/LoginPage.js b/app/containers/LoginPage.js index 51cdd297c2..77b099df98 100644 --- a/app/containers/LoginPage.js +++ b/app/containers/LoginPage.js @@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch, props) => { return user.loginChange({ account }); }, onFirstChangeAfterFailure: () => { - return user.loginChange({ status: LoginState.none, error: undefined }) + return user.loginChange({ status: LoginState.none, error: undefined }); } }; }; diff --git a/app/lib/backend.js b/app/lib/backend.js index 7d94baa5a5..55560cca2c 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -31,7 +31,7 @@ class BackendImpl { if(account.startsWith('1111')) { resolve(true); } else { - reject(new Error("Invalid account number.")); + reject(new Error('Invalid account number.')); } }, 2000); }); @@ -73,4 +73,4 @@ export default class Backend { return getImpl(this).logout(); } -}; +} diff --git a/app/lib/enum.js b/app/lib/enum.js index bc8e4b54aa..4359c3bfb3 100644 --- a/app/lib/enum.js +++ b/app/lib/enum.js @@ -1,5 +1,3 @@ -import assert from 'assert'; - /** * Creates enum object with keys provided as arguments */ @@ -17,4 +15,4 @@ export default function Enum() { Object.freeze(object); return object; -}; +} diff --git a/app/reducers/user.js b/app/reducers/user.js index 1d74cb31fd..683d300654 100644 --- a/app/reducers/user.js +++ b/app/reducers/user.js @@ -5,7 +5,7 @@ import actions from '../actions/user'; import { LoginState } from '../constants'; const initialState = { - account: "", + account: '', status: LoginState.none }; |
