From 6e889c7a4f3ca17c03a5049e5ad13798ab98f60d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 31 Jan 2022 11:18:44 -0600 Subject: [PATCH] Mastodon: fall back to account lookup API --- app/soapbox/actions/accounts.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/soapbox/actions/accounts.js b/app/soapbox/actions/accounts.js index aacdcd106..fe0f5519a 100644 --- a/app/soapbox/actions/accounts.js +++ b/app/soapbox/actions/accounts.js @@ -156,14 +156,7 @@ export function fetchAccountByUsername(username) { const features = getFeatures(instance); const me = state.get('me'); - if (!me && features.accountLookup) { - dispatch(accountLookup(username)).then(account => { - dispatch(fetchAccountSuccess(account)); - }).catch(error => { - dispatch(fetchAccountFail(null, error)); - dispatch(importErrorWhileFetchingAccountByUsername(username)); - }); - } else if (features.accountByUsername) { + if (features.accountByUsername && (me || !features.accountLookup)) { api(getState).get(`/api/v1/accounts/${username}`).then(response => { dispatch(fetchRelationships([response.data.id])); dispatch(importFetchedAccount(response.data)); @@ -172,6 +165,13 @@ export function fetchAccountByUsername(username) { dispatch(fetchAccountFail(null, error)); dispatch(importErrorWhileFetchingAccountByUsername(username)); }); + } else if (features.accountLookup) { + dispatch(accountLookup(username)).then(account => { + dispatch(fetchAccountSuccess(account)); + }).catch(error => { + dispatch(fetchAccountFail(null, error)); + dispatch(importErrorWhileFetchingAccountByUsername(username)); + }); } else { dispatch(accountSearch({ q: username,