From 55e4712f28e8b2e01dc86a91f2de8c2f05c0b040 Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 27 Jul 2026 09:46:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(assets):=20=E5=88=A0=E9=99=A4=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E3=80=8C=E7=B4=A0=E6=9D=90=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E3=80=8D=E6=97=B6=E5=88=B7=E6=96=B0=E7=BD=91=E6=A0=BC=E8=87=AA?= =?UTF-8?q?=E6=84=88=E8=BF=87=E6=9C=9F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 行已被其他会话/重建删除时,本页网格仍显示幽灵卡片(success:false 不触发 reload)。refs 为空的业务拒绝即「行已不在 DB」,此时同样 bump reload, 让网格收敛到服务端真实状态;引用中拒绝(refs 非空)不误刷新。 --- src/pages/admin/assets.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/admin/assets.rs b/src/pages/admin/assets.rs index 850c3a6..5231038 100644 --- a/src/pages/admin/assets.rs +++ b/src/pages/admin/assets.rs @@ -381,8 +381,11 @@ pub fn Assets() -> Element { spawn(async move { match delete_asset(id).await { Ok(resp) => { + // 行已不在 DB(refs 为空的业务拒绝 = 素材不存在) + // 说明网格是过期数据,同样触发刷新自愈。 + let stale = !resp.success && resp.refs.is_empty(); op_message.set(Some(resp.message)); - if resp.success { + if resp.success || stale { reload.set(reload() + 1); } }