From 818f58b4609496672515439bd453a4849caab8f5 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 1 Aug 2024 20:18:44 +0800 Subject: [PATCH] Fix profile URLs not working for http route --- src/pages/http-route.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/http-route.jsx b/src/pages/http-route.jsx index c2cf1865..e7617230 100644 --- a/src/pages/http-route.jsx +++ b/src/pages/http-route.jsx @@ -24,11 +24,13 @@ export default function HttpRoute() { // Check if status returns 200 try { const { instance, id } = statusObject; - const { masto } = api({ instance }); - const status = await masto.v1.statuses.$select(id).fetch(); - if (status) { - window.location.hash = statusURL + '?view=full'; - return; + if (id) { + const { masto } = api({ instance }); + const status = await masto.v1.statuses.$select(id).fetch(); + if (status) { + window.location.hash = statusURL + '?view=full'; + return; + } } } catch (e) {}