Correctly import settings on login

This commit is contained in:
Alex Gleason
2021-03-25 16:39:52 -05:00
parent 659cee1c49
commit 619d298547

View File

@ -1,6 +1,7 @@
import api from '../api';
import { importFetchedAccount } from './importer';
import snackbar from 'soapbox/actions/snackbar';
import { ME_FETCH_SUCCESS } from 'soapbox/actions/me';
export const SWITCH_ACCOUNT = 'SWITCH_ACCOUNT';
@ -150,6 +151,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 });
return account;
}).catch(error => {
dispatch({ type: VERIFY_CREDENTIALS_FAIL, token, error });