Merge pull request #1734 from RoboSats/hide-secure-alert-notification-on-onion-address

Fix react
This commit is contained in:
KoalaSat 2025-02-13 13:15:06 +00:00 committed by GitHub
commit a74c477dc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -9,7 +9,7 @@ const HostAlert = (): JSX.Element => {
!hostUrl.includes('robosats') && (client === 'selfhosted' || client === 'desktop') !hostUrl.includes('robosats') && (client === 'selfhosted' || client === 'desktop')
? SelfhostedAlert ? SelfhostedAlert
: UnsafeAlert; : UnsafeAlert;
return hostUrl.endsWith('.onion') ? <></> : component(); return component();
}; };
export default HostAlert; export default HostAlert;