fix(images): 缩略图 MIME 魔数嗅探 + 取消在用 objectURL 撤销 + 缩略图回收(v3.25.78/79)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
This commit is contained in:
1 parent
f02b3dcec2
commit
2860faacbb
17 files changed
+170
-40
No files matched your search
@@ -5850,6 +5850,16 @@ const tbCenterSeed = (type, refs) => {
|
||||
}, [])
|
||||
const [thumbRev, setThumbRev] = React.useState(0) // v3.87.7:显示缩略图就绪后触发一次 re-render(必须在 Workbench 内)
|
||||
useEffect(() => { wThumbBump = () => setThumbRev((v) => v + 1); return () => { wThumbBump = null } }, [])
|
||||
// 缩略图回收(v3.25.78):启动 8 秒后按 300MB 上限清理最老的缩略图,不抢首帧
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
try {
|
||||
const F = wStoreMod()
|
||||
if (F && typeof F.pruneThumbs === 'function') F.pruneThumbs(300).catch(() => { /* ignore */ })
|
||||
} catch (e) { /* ignore */ }
|
||||
}, 8000)
|
||||
return () => clearTimeout(timer)
|
||||
}, [])
|
||||
// 外观实时预览(v3.25.76):设置面板每改一个外观项都会派发该事件,
|
||||
// 这里只 bump 一次渲染,让网格贴图按新的间距/颜色/样式重新生成。
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user