mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
refactor: Move logging to proper conditional block
This commit is contained in:
parent
be94406c49
commit
6b05b7d6a9
1 changed files with 3 additions and 4 deletions
|
@ -74,10 +74,6 @@ export default function Counter(props: SharedProps) {
|
|||
|
||||
clearTimeout(timer);
|
||||
setTimer(setTimeout(() => {
|
||||
console.info(
|
||||
`[${new Date()}] Updating global count: ${internalCount + 1}`,
|
||||
);
|
||||
|
||||
// guard against numbers that are beyond MAX_SAFE_INTEGER.
|
||||
if (internalCount === Number.MAX_SAFE_INTEGER) {
|
||||
console.warn(
|
||||
|
@ -90,6 +86,9 @@ export default function Counter(props: SharedProps) {
|
|||
window.location.href,
|
||||
JSON.stringify({ data: internalCount + 1 }),
|
||||
);
|
||||
console.info(
|
||||
`[${new Date()}] Updating global count: ${internalCount + 1}`,
|
||||
);
|
||||
setInternalCount(0);
|
||||
}
|
||||
}, 5000));
|
||||
|
|
Loading…
Reference in a new issue