mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
Only add a timer on click
This commit is contained in:
parent
1a42b2ccf0
commit
38df720102
1 changed files with 0 additions and 5 deletions
|
@ -23,11 +23,6 @@ export default function Counter(props: SharedProps) {
|
|||
// whenever a user activity is detected
|
||||
let timer: number;
|
||||
|
||||
timer = setTimeout(() => {
|
||||
axios.post(window.location.href, JSON.stringify({ data: internalCount }));
|
||||
setInternalCount(0);
|
||||
}, 5000)
|
||||
|
||||
window.onclick = () => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
|
|
Loading…
Reference in a new issue