Skip to content

Commit

Permalink
fix temiout var name
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Oct 10, 2022
1 parent 3c61def commit 339b002
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/scriptlets/trusted-click-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function trustedClickElement(source, selectors, extraMatch = '', delay =
// eslint-disable-next-line no-console
const log = console.log.bind(console);

const OBSERVER_TIMEOUT = 10000;
const OBSERVER_TIMEOUT_MS = 10000;
const THROTTLE_DELAY_MS = 20;
const COOKIE_MATCH_MARKER = 'cookie:';
const LOCAL_STORAGE_MATCH_MARKER = 'localStorage:';
Expand All @@ -70,9 +70,9 @@ export function trustedClickElement(source, selectors, extraMatch = '', delay =
let parsedDelay;
if (delay) {
parsedDelay = parseInt(delay, 10);
const isValidDelay = !Number.isNaN(parsedDelay) || parsedDelay < OBSERVER_TIMEOUT;
const isValidDelay = !Number.isNaN(parsedDelay) || parsedDelay < OBSERVER_TIMEOUT_MS;
if (!isValidDelay) {
log(`Passed delay '${delay}' is invalid or bigger than ${OBSERVER_TIMEOUT} ms`);
log(`Passed delay '${delay}' is invalid or bigger than ${OBSERVER_TIMEOUT_MS} ms`);
return;
}
}
Expand Down Expand Up @@ -254,7 +254,7 @@ export function trustedClickElement(source, selectors, extraMatch = '', delay =
}, parsedDelay);
}

setTimeout(() => observer.disconnect(), OBSERVER_TIMEOUT);
setTimeout(() => observer.disconnect(), OBSERVER_TIMEOUT_MS);
}

trustedClickElement.names = [
Expand Down

0 comments on commit 339b002

Please sign in to comment.