Skip to content

Commit 61c7a50

Browse files
Increment on recheck and clear timers always
1 parent a8ca6ee commit 61c7a50

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

injected/src/features/page-context.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,20 @@ export default class PageContext extends ContentFeature {
225225
* Schedule a delayed recheck after navigation events
226226
*/
227227
scheduleDelayedRecheck() {
228-
if (this.recheckLimit > 0 && this.recheckCount >= this.recheckLimit) {
229-
return;
230-
}
231-
this.recheckCount++;
232-
233228
// Clear any existing delayed recheck
234229
if (this.#delayedRecheckTimer) {
235230
clearTimeout(this.#delayedRecheckTimer);
236231
}
232+
if (this.recheckLimit > 0 && this.recheckCount >= this.recheckLimit) {
233+
return;
234+
}
237235

238236
const delayMs = this.getFeatureSetting('navigationRecheckDelayMs') || 1500;
239237

240238
this.log.info('Scheduling delayed recheck', { delayMs });
241239
this.#delayedRecheckTimer = setTimeout(() => {
242240
this.log.info('Performing delayed recheck after navigation');
243-
241+
this.recheckCount++;
244242
// Invalidate existing cache
245243
this.invalidateCache();
246244
this.clearTimers();

0 commit comments

Comments
 (0)