diff --git a/src/pages/HttpRoute.jsx b/src/pages/HttpRoute.jsx index 3c9729d2..d54b5715 100644 --- a/src/pages/HttpRoute.jsx +++ b/src/pages/HttpRoute.jsx @@ -1,3 +1,4 @@ +import { useLayoutEffect } from 'preact/hooks'; import { useLocation } from 'react-router-dom'; import Link from '../components/link'; @@ -7,18 +8,34 @@ export default function HttpRoute() { const location = useLocation(); const url = location.pathname.replace(/^\//, ''); const statusURL = getInstanceStatusURL(url); - if (statusURL) { - window.location.hash = statusURL + '?view=full'; - return null; - } + + useLayoutEffect(() => { + if (statusURL) { + setTimeout(() => { + window.location.hash = statusURL + '?view=full'; + }, 300); + } + }, [statusURL]); + return (
- - {url} - -
+ {statusURL ? ( + <> ++ {statusURL} +
+ > + ) : ( + <> ++ + {url} + +
+ > + )}Go home