Stop form from reloading page
This commit is contained in:
parent
e539eb0a75
commit
13f8852622
4 changed files with 7 additions and 4 deletions
|
|
@ -26,6 +26,7 @@ form {
|
|||
cursor: pointer;
|
||||
color: var(--text);
|
||||
margin: 0 0 0 6px;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.saveButton:hover {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const FingerprintBlock = ({ workerData }) => {
|
|||
if you clear cookies, change your IP or use private mode the hash will
|
||||
stay the same. Enter a signature and turn on a VPN to test it out.
|
||||
</p>
|
||||
<form onSubmit={(e) => postSignature(hash, e.target[0].value)}>
|
||||
<form onSubmit={(e) => postSignature(hash, e, setSignature)}>
|
||||
<input
|
||||
type="text"
|
||||
id="signature"
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ const getConnection = (data) => {
|
|||
issues: [isProxy],
|
||||
},
|
||||
{
|
||||
key: 'Organization',
|
||||
key: 'Org',
|
||||
value: data.org,
|
||||
issues: [isProxy],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,11 +14,13 @@ const getSignature = (hash, setSignature, setload) => {
|
|||
});
|
||||
};
|
||||
|
||||
const postSignature = (hash, signature) => {
|
||||
const postSignature = (hash, e, setSignature) => {
|
||||
e.preventDefault();
|
||||
axios.post('https://api.vytal.io/fingerprint/', {
|
||||
name: signature,
|
||||
name: e.target[0].value,
|
||||
hash,
|
||||
});
|
||||
setSignature(e.target[0].value);
|
||||
};
|
||||
|
||||
const getHash = (data) => md5(JSON.stringify(data)).toString();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue