浏览代码

Update

stable1
B.E.N.S.O.N 2 周前
父节点
当前提交
9be15c0d1c
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. +9
    -0
      src/app/(main)/report/page.tsx

+ 9
- 0
src/app/(main)/report/page.tsx 查看文件

@@ -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);
}, []);



正在加载...
取消
保存