mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-22 05:09:01 +00:00
Merge pull request #1734 from RoboSats/hide-secure-alert-notification-on-onion-address
Fix react
This commit is contained in:
commit
a74c477dc7
@ -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 <></>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user