diff --git a/app/soapbox/actions/auth.js b/app/soapbox/actions/auth.js index bc714be39..5d4d4529d 100644 --- a/app/soapbox/actions/auth.js +++ b/app/soapbox/actions/auth.js @@ -2,7 +2,7 @@ import api from '../api'; import { importFetchedAccount } from './importer'; import snackbar from 'soapbox/actions/snackbar'; import { createAccount } from 'soapbox/actions/accounts'; -import { ME_FETCH_SUCCESS } from 'soapbox/actions/me'; +import { fetchMeSuccess } from 'soapbox/actions/me'; export const SWITCH_ACCOUNT = 'SWITCH_ACCOUNT'; @@ -149,7 +149,7 @@ export function verifyCredentials(token) { return api(getState).request(request).then(({ data: account }) => { dispatch(importFetchedAccount(account)); dispatch({ type: VERIFY_CREDENTIALS_SUCCESS, token, account }); - if (account.id === getState().get('me')) dispatch({ type: ME_FETCH_SUCCESS, me: account }); + if (account.id === getState().get('me')) dispatch(fetchMeSuccess(account)); return account; }).catch(error => { dispatch({ type: VERIFY_CREDENTIALS_FAIL, token, error }); diff --git a/app/soapbox/actions/me.js b/app/soapbox/actions/me.js index 497e08b94..602334bd0 100644 --- a/app/soapbox/actions/me.js +++ b/app/soapbox/actions/me.js @@ -25,9 +25,7 @@ export function fetchMe() { }; dispatch(fetchMeRequest()); - return dispatch(verifyCredentials(token)).then(account => { - dispatch(fetchMeSuccess(account)); - }).catch(error => { + return dispatch(verifyCredentials(token)).catch(error => { dispatch(fetchMeFail(error)); });; };