diff --git a/frontend/src/components/HostAlert/UnsafeAlert.tsx b/frontend/src/components/HostAlert/UnsafeAlert.tsx index ae00d2e9..2d88e097 100644 --- a/frontend/src/components/HostAlert/UnsafeAlert.tsx +++ b/frontend/src/components/HostAlert/UnsafeAlert.tsx @@ -32,6 +32,7 @@ function federationUrls(): string[] { export const safeUrls = federationUrls(); const UnsafeAlert = (): JSX.Element => { + const { hostUrl } = useContext(AppContext); const { windowSize } = useContext(AppContext); const { t } = useTranslation(); const [show, setShow] = useState(true); @@ -47,8 +48,7 @@ const UnsafeAlert = (): JSX.Element => { checkClient(); }, []); - // If alert is hidden return null - if (!show) { + if (hostUrl.endsWith('.onion') || !show) { return <>; } diff --git a/frontend/src/components/HostAlert/index.tsx b/frontend/src/components/HostAlert/index.tsx index 37f8cdaf..7dee8f94 100644 --- a/frontend/src/components/HostAlert/index.tsx +++ b/frontend/src/components/HostAlert/index.tsx @@ -9,7 +9,7 @@ const HostAlert = (): JSX.Element => { !hostUrl.includes('robosats') && (client === 'selfhosted' || client === 'desktop') ? SelfhostedAlert : UnsafeAlert; - return hostUrl.endsWith('.onion') ? <> : component(); + return component(); }; export default HostAlert;