Fix react

This commit is contained in:
koalasat 2025-02-13 14:14:25 +01:00
parent 97641cfee7
commit 40850c4e5e
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157
2 changed files with 3 additions and 3 deletions

View File

@ -32,6 +32,7 @@ function federationUrls(): string[] {
export const safeUrls = federationUrls();
const UnsafeAlert = (): JSX.Element => {
const { hostUrl } = useContext<UseAppStoreType>(AppContext);
const { windowSize } = useContext<UseAppStoreType>(AppContext);
const { t } = useTranslation();
const [show, setShow] = useState<boolean>(true);
@ -47,8 +48,7 @@ const UnsafeAlert = (): JSX.Element => {
checkClient();
}, []);
// If alert is hidden return null
if (!show) {
if (hostUrl.endsWith('.onion') || !show) {
return <></>;
}

View File

@ -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;