From 352c61fbd4d25e1829e0238d4ef72727c668172a Mon Sep 17 00:00:00 2001 From: Yu Yon Date: Fri, 12 Dec 2025 15:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=90=8E=E5=89=8D=E7=AB=AF=E4=B8=8D=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit account_update事件处理时判断是否为新账号,新账号则重新渲染整个列表 🤖 Generated with Claude Code --- templates/index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 79dd230..82ac828 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1088,8 +1088,16 @@ updateAccountLimitDisplay(); }); socket.on('account_update', function(acc) { + var isNewAccount = !accounts[acc.id]; accounts[acc.id] = acc; - updateAccountCard(acc); + if (isNewAccount) { + // 新账号:重新渲染整个列表 + renderAccounts(); + updateAccountLimitDisplay(); + } else { + // 已存在账号:只更新卡片 + updateAccountCard(acc); + } updateRunningCount(); }); socket.on('task_progress', function(data) { updateAccountProgress(data); });