From cffaedb297fc007ae11249f321739b5a15026898 Mon Sep 17 00:00:00 2001 From: MikiVL Date: Tue, 5 May 2026 03:41:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A9=BA=E7=AC=94=E8=AE=B0=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=98=85=E8=AF=BB=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/Editor.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx index fcef0bf..ea7bab1 100644 --- a/src/components/editor/Editor.tsx +++ b/src/components/editor/Editor.tsx @@ -345,7 +345,7 @@ export function Editor() { return } - const readingTime = Math.max(1, Math.ceil(wordCount / 250)) + const readingTime = wordCount > 0 ? Math.max(1, Math.ceil(wordCount / 250)) : 0 return (
@@ -488,7 +488,7 @@ export function Editor() { className="flex items-center justify-between px-12 py-2 text-xs shrink-0" style={{ borderTop: '1px solid var(--border)', color: 'var(--text-faint)', background: 'var(--bg)' }} > - {wordCount} 字 · 约 {readingTime} 分钟阅读 + {wordCount} 字{wordCount > 0 ? ` · 约 ${readingTime} 分钟阅读` : ''} {saveStatus === 'saving' ? '保存中…' : saveStatus === 'unsaved' ? '未保存' : '已自动保存'}