Fix profile URLs not working for http route

This commit is contained in:
Lim Chee Aun 2024-08-01 20:18:44 +08:00
parent 57db8778a4
commit 818f58b460

View file

@ -24,12 +24,14 @@ export default function HttpRoute() {
// Check if status returns 200 // Check if status returns 200
try { try {
const { instance, id } = statusObject; const { instance, id } = statusObject;
if (id) {
const { masto } = api({ instance }); const { masto } = api({ instance });
const status = await masto.v1.statuses.$select(id).fetch(); const status = await masto.v1.statuses.$select(id).fetch();
if (status) { if (status) {
window.location.hash = statusURL + '?view=full'; window.location.hash = statusURL + '?view=full';
return; return;
} }
}
} catch (e) {} } catch (e) {}
// Fallback to search // Fallback to search