Added adblock error to location

This commit is contained in:
z0ccc 2021-07-24 00:48:33 -04:00
parent 83d864df32
commit 38401bf4c1
3 changed files with 22 additions and 11 deletions

View file

@ -65,7 +65,7 @@ const ConnectBlock = () => {
{display === 1 && <Table data={data} />}
{display === 0 && (
<div className="boxWrap">
Unable to load data. Adblock or content filter may have blocked data from loading.
Unable to fetch info. Adblock or content filter may have prevented data from loading.
</div>
)}
<p>

View file

@ -4,14 +4,17 @@ import Table from './Table';
const LocationBlock = () => {
const [locationData, setLocationData] = useState('');
const [display, setDisplay] = useState('none');
const [display, setDisplay] = useState('');
useEffect(() => {
fetch('http://ip-api.com/json')
.then((response) => response.json())
.then((data) => {
setLocationData(data);
setDisplay('block');
setDisplay(1);
})
.catch(() => {
setDisplay(0);
});
}, []);
@ -53,10 +56,18 @@ const LocationBlock = () => {
return (
<ScanBlock>
<h1>Location</h1>
<div style={{ display }}>
{display === 1 && (
<>
<img src={mapUrl} alt="Map of current location" />
<Table data={data} />
</>
)}
{display === 0 && (
<div className="boxWrap">
Unable to fetch info. Adblock or content filter may have prevented
data from loading.
</div>
)}
<p>
<b>Explanation:</b> Your IP address can be used to determine your
location. Using a VPN or Tor will hide your true location.

View file

@ -7,15 +7,15 @@ import FiltersBlock from './FiltersBlock';
// import FontsBlock from './FontsBlock';
const ScanBlocks = () => (
<div>
<ConnectBlock />
<>
<FingerprintBlock />
<FiltersBlock />
<LocationBlock />
<ConnectBlock />
<FiltersBlock />
<SoftwareBlock />
<HardwareBlock />
{/* <FontsBlock /> */}
</div>
</>
);
export default ScanBlocks;