Skip to content

Commit 6abf7e5

Browse files
committed
don't track scroll depth on short (non scrollable) pages
1 parent 125bf64 commit 6abf7e5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/components/track-reader-depth.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ export function ReaderDepthTracker() {
4949
}
5050
};
5151

52-
// if the totalHeight is zero, we can't calculate the progress, the user is alredy at 100%
53-
// the early return prevents division by zero in the trackProgress function
52+
// if the page is not scrollable, we don't need to track anything
5453
if (document.documentElement.scrollHeight - window.innerHeight === 0) {
55-
sendProgressToPlausible(100);
5654
return () => {};
5755
}
5856
const debouncedTrackProgress = debounce(trackProgress, 20);

0 commit comments

Comments
 (0)