From 33513757a387d114f77943416a200e99ebedf7ee Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Sun, 14 Jun 2026 00:57:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20renderNode=20=E5=86=85=20t=20?= =?UTF-8?q?=E8=A2=AB=20task=20=E5=8F=82=E6=95=B0=E9=81=AE=E8=94=BD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20t=20is=20not=20a=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderNode=(t)=> 里 t 是任务对象,line 1418 的 t('depsWait') 调用 全局 i18n 函数时 t 已被遮蔽。在 renderNode 前保存 const i18n=t, 内部改用 i18n(),消除 "t is not a function" 错误。 Co-Authored-By: Claude Sonnet 4.6 --- web/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index 72435dd..915716c 100644 --- a/web/app.js +++ b/web/app.js @@ -1393,6 +1393,7 @@ function renderTree() { return; } const byId = new Map(S.tasks.map((x) => [x.id, x])); + const i18n = t; // t will be shadowed by the task parameter inside renderNode const renderNode = (t) => { if (vis && !vis.visible.has(t.id)) return ''; const kids = m.get(t.id) || []; @@ -1415,7 +1416,7 @@ function renderTree() { const unmet = t.deps.filter((d) => byId.get(d)?.status !== 'done'); if (!unmet.length) return ''; const depSep2 = i18nState.lang === 'zh' ? '、' : ', '; - return `${icon('deps')} ${t('depsWait', { n: unmet.length })}`; + return `${icon('deps')} ${i18n('depsWait', { n: unmet.length })}`; })()} P${t.priority} ${cplxBadge(t.complexity, t.id)}