fix(gallery): 删除后不残留「图片已丢失」格子(deleteOutputs 返回 Promise + 插件本地先摘除)v3.25.55

- deleteOutputs 返回 Promise(删除+refreshOutputs 完成才 resolve)
- capability.remove 等删除完成再返回
- gallery 1.2.1:先本地摘除重排,250ms 后重拉校正
- 回归测试增加删除场景
This commit is contained in:
qiqi committed 2026-11-20 12:15:02 +08:00
1 parent 5c378c3d73
commit d5449e8b71
10 files changed
+54 -15

No files matched your search

+5 -3
View File
@@ -2043,11 +2043,13 @@
}
const deleteOutputs = (names) => {
const list = Array.isArray(names) ? names : []
if (!list.length) return
api('outputs', { action: 'delete', names: list }).then(() => {
if (!list.length) return Promise.resolve(0)
// v3.25.55:返回 Promise(调用方可等删除+刷新完成再重拉列表,避免 UI 里残留「图片已丢失」格子)
return api('outputs', { action: 'delete', names: list }).then(() => {
refreshOutputs()
setNotice({ type: 'ok', text: '已删除 ' + list.length + ' 张图片' })
}).catch(() => setNotice({ type: 'err', text: '删除失败' }))
return list.length
}).catch(() => { setNotice({ type: 'err', text: '删除失败' }); return 0 })
}
const loadDemo = () => {
CanvasStore.replace([