fix(gallery): 缓存命中改用微任务绘制(同步挂载后立即出图)
validate / validate (push) Canceled after 0s

This commit is contained in:
qiqi committed 2026-11-22 00:07:52 +08:00
1 parent 930ca2b02a
commit 59b6393e8a
1 file changed
+1 -1
+1 -1
View File
@@ -355,7 +355,7 @@
// v1.6.9:缩略图地址按名字缓存,且进行中的请求共享同一 Promise ——
// 重排/重测会重建 DOM,不共享就会对同一张图重复取 N 次。
var key = it.name
if (thumbCache[key]) { var u0 = thumbCache[key]; setTimeout(function () { paint(u0) }, 0); return }
if (thumbCache[key]) { var u0 = thumbCache[key]; Promise.resolve().then(function () { paint(u0) }).catch(function () { /* ignore */ }); return }
if (!thumbPending[key]) {
thumbPending[key] = Promise.resolve(ctx.gallery.thumb(key)).then(function (url) {
if (url && typeof url === 'string') thumbCache[key] = url