diff --git a/frontend/src/components/FingerprintBlock.js b/frontend/src/components/FingerprintBlock.js index ffc7d06..4c8e995 100644 --- a/frontend/src/components/FingerprintBlock.js +++ b/frontend/src/components/FingerprintBlock.js @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ import { useState, useEffect } from 'react'; import Block from './Block'; import Table from './Table'; @@ -11,37 +10,36 @@ import { const FingerprintBlock = ({ workerData }) => { const [signature, setSignature] = useState(); + const [load, setload] = useState(false); + const hash = getHash(workerData); useEffect(() => { - if (signature) { - postSignature(hash, signature); - } else { - getSignature(hash, setSignature); - } - }, [signature]); + getSignature(hash, setSignature, setload); + }, []); - const hash = getHash(workerData); return (

Fingerprint

- <> - {signature ? ( -
- - - ) : ( -
-
{hash}
-
- )} - + {load && ( + <> + {signature !== undefined ? ( +
+
+ + ) : ( +
+
{hash}
+
+ )} + + )}

Explanation: This is a unique identifier that can be used to follow you around the web. Even if you clear cookies, change your IP or use private mode the hash will stay the same. Enter your name below and reload the page in private mode to test it out.

- setSignature(e.target[0].value)}> + postSignature(hash, e.target[0].value)}> { - console.log('1'); +const getSignature = (hash, setSignature, setload) => { axios .get(`https://api.vytal.io/fingerprint/?hash=${hash}`) .then((response) => { - console.log(response.data[response.data.length - 1]); - if (response.data.length !== 0) { setSignature(response.data[response.data.length - 1].name); } + setload(true); }); };