From f0ecca6b9b814f43e17d4edc61cbf14b2c59554c Mon Sep 17 00:00:00 2001 From: Zeck Li <11781254+zeckli@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:02:39 +0800 Subject: [PATCH] fix(tracker): fix read timer does not work if user bounces immediately --- src/components/Hook/useReadTimer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Hook/useReadTimer.ts b/src/components/Hook/useReadTimer.ts index 67cfd0389a..02f4a3efb2 100644 --- a/src/components/Hook/useReadTimer.ts +++ b/src/components/Hook/useReadTimer.ts @@ -25,7 +25,7 @@ export const useReadTimer = ({ articleId, container }: Props) => { }, 3000) const storeReadTime = () => { - if (articleId && readTimer?.current) + if (articleId && readTimer) analytics.trackEvent('read_time', { articleId, time: readTimer.current,