fix(assets): 删除返回「素材不存在」时刷新网格自愈过期数据
行已被其他会话/重建删除时,本页网格仍显示幽灵卡片(success:false 不触发 reload)。refs 为空的业务拒绝即「行已不在 DB」,此时同样 bump reload, 让网格收敛到服务端真实状态;引用中拒绝(refs 非空)不误刷新。
This commit is contained in:
parent
b98059edcc
commit
55e4712f28
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user