diff --git a/src/pages/http-route.jsx b/src/pages/http-route.jsx index 46290d07..c2cf1865 100644 --- a/src/pages/http-route.jsx +++ b/src/pages/http-route.jsx @@ -37,16 +37,20 @@ export default function HttpRoute() { const { masto: currentMasto, instance: currentInstance } = api(); const result = await currentMasto.v2.search.fetch({ q: url, - type: 'statuses', limit: 1, resolve: true, }); if (result.statuses.length) { const status = result.statuses[0]; window.location.hash = `/${currentInstance}/s/${status.id}?view=full`; - } else { + } else if (result.accounts.length) { + const account = result.accounts[0]; + window.location.hash = `/${currentInstance}/a/${account.id}`; + } else if (statusURL) { // Fallback to original URL, which will probably show error window.location.hash = statusURL + '?view=full'; + } else { + setUIState('error'); } } })();