|
|
|
@@ -143,7 +143,16 @@ export default function ReportPage() { |
|
|
|
setDynamicOptions({}); |
|
|
|
}, [selectedReportId]); |
|
|
|
|
|
|
|
// React 18 Strict Mode (dev) mounts → unmounts → remounts, so effects with [] run twice. |
|
|
|
// Dedupe PAGE_VIEW within a short window so 進入頁面次數 is +1 per real visit. |
|
|
|
useEffect(() => { |
|
|
|
if (typeof window === "undefined") return; |
|
|
|
const w = window as Window & { __fpsmsReportPageViewLoggedAt?: number }; |
|
|
|
const now = Date.now(); |
|
|
|
if (w.__fpsmsReportPageViewLoggedAt != null && now - w.__fpsmsReportPageViewLoggedAt < 2000) { |
|
|
|
return; |
|
|
|
} |
|
|
|
w.__fpsmsReportPageViewLoggedAt = now; |
|
|
|
logFeatureUsage(FEATURE_USAGE.REPORT_MANAGEMENT, FEATURE_USAGE_ACTION.PAGE_VIEW); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|