Skip to content

Commit

Permalink
fix: resetting annotation count when page changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Huellen committed Sep 17, 2024
1 parent 334bc76 commit 40cbe68
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/common/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,18 @@ export const _test = (
return;
}

const currentPage = page.url();

const isSamePage = previousPage === currentPage;

if (!isSamePage) {
annotationCount = 0;
}

const { progressions } = decisions;
const { enabled } = progressions;

const currentPage = page.url();

if (enabled && previousPage === currentPage && selector !== undefined) {
if (enabled && isSamePage && selector !== undefined) {
await progress(page, selector);
}
} while (interactionCount < maxInteractions);
Expand Down

0 comments on commit 40cbe68

Please sign in to comment.