fix: v3.26.174 插件写回图片后失效缩略图缓存并重渲染(修标注覆盖后不落地/CPU 空转)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m3s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m3s
This commit is contained in:
1 parent
e2b976413c
commit
7833e6c4fe
5 files changed
+25
-6
No files matched your search
@@ -6178,9 +6178,28 @@ const tbCenterSeed = (type, refs) => {
|
||||
setNodeImage: (id, dataUrl) => {
|
||||
if (!/^data:/i.test(String(dataUrl || ''))) return false
|
||||
const t = refs.nodes.find((x) => x.id === id); if (!t) return false
|
||||
updateNode(id, origImagePatch(t.data || {}, String(dataUrl))); return true
|
||||
updateNode(id, origImagePatch(t.data || {}, String(dataUrl)))
|
||||
// v3.26.174:同步失效这张图的缩略图/URL 缓存并触发重渲染(与 saveNodeImage 同因)
|
||||
try { const k = wDisplayThumbKeyOf(String(dataUrl || '')); if (k) { displayThumbs.delete(k); displayThumbsSm.delete(k) } } catch (e1) { /* ignore */ }
|
||||
try { if (typeof wThumbBump === 'function') wThumbBump() } catch (e2) { /* ignore */ }
|
||||
return true
|
||||
},
|
||||
saveNodeImage: (id, dataUrl) => {
|
||||
if (!IWWorkbenchLogic) return Promise.resolve({ ok: false, error: '画布能力未就绪' })
|
||||
return IWWorkbenchLogic.saveNodeImage({ refs, commitCanvas, saveNow, readWorkspace: () => WorkspaceStore.read(null), activeWsId: () => activeWsIdRef.current || activeWsId, origPatch: origImagePatch }, id, dataUrl).then((r) => {
|
||||
// v3.26.174:写回成功后必须让「这张图」重新出图 —— 之前只改了节点数据,
|
||||
// 缩略图/URL 缓存与节点体都没失效,界面一直显示旧图或空白,
|
||||
// 直到用户点「立即回收内存」清缓存才显示出来(CPU 期间一直在反复重绘/重解码)。
|
||||
if (r && r.ok) {
|
||||
try {
|
||||
const k = wDisplayThumbKeyOf(String(dataUrl || ''))
|
||||
if (k) { displayThumbs.delete(k); displayThumbsSm.delete(k) }
|
||||
} catch (e1) { /* ignore */ }
|
||||
try { if (typeof wThumbBump === 'function') wThumbBump() } catch (e2) { /* ignore */ }
|
||||
}
|
||||
return r
|
||||
})
|
||||
},
|
||||
saveNodeImage: (id, dataUrl) => (IWWorkbenchLogic ? IWWorkbenchLogic.saveNodeImage({ refs, commitCanvas, saveNow, readWorkspace: () => WorkspaceStore.read(null), activeWsId: () => activeWsIdRef.current || activeWsId, origPatch: origImagePatch }, id, dataUrl) : Promise.resolve({ ok: false, error: '画布能力未就绪' })),
|
||||
}
|
||||
return () => { wPluginCanvasBridge = null }
|
||||
}, [])
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.173",
|
||||
"version": "3.26.174",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -2014,7 +2014,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.172"
|
||||
version = "3.26.173"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.173"
|
||||
version = "3.26.174"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.173",
|
||||
"version": "3.26.174",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
Reference in new issue
Block a user