From 74a587583886393baedb061046931fb090ee2649 Mon Sep 17 00:00:00 2001 From: xiamuceer-j Date: Thu, 12 Feb 2026 12:40:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E4=BC=8F?= =?UTF-8?q?=E7=AC=94=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E7=AB=A0=E8=8A=82=E5=8F=B7=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E6=97=A0=E5=86=85=E5=AE=B9=E7=AB=A0=E8=8A=82=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Foreshadows.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Foreshadows.tsx b/frontend/src/pages/Foreshadows.tsx index 83dcd14..b33fc85 100644 --- a/frontend/src/pages/Foreshadows.tsx +++ b/frontend/src/pages/Foreshadows.tsx @@ -126,9 +126,10 @@ export default function Foreshadows() { const loadStats = useCallback(async () => { if (!projectId) return; try { - // 获取当前最大章节号 - const maxChapter = chapters.length > 0 - ? Math.max(...chapters.map(c => c.chapter_number)) + // 获取当前最大章节号(只计算有内容的章节,与表格显示逻辑保持一致) + const chaptersWithContent = chapters.filter(c => c.content); + const maxChapter = chaptersWithContent.length > 0 + ? Math.max(...chaptersWithContent.map(c => c.chapter_number)) : undefined; const statsData = await foreshadowApi.getForeshadowStats(projectId, maxChapter); setStats(statsData);