Correctly import settings on login

bundle-emoji
Alex Gleason 2021-03-25 16:39:52 -05:00
rodzic 659cee1c49
commit 619d298547
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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 });