fix: v3.26.175 覆盖替换图片时清掉 localRef/ref(旧引用一直压过新图)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m53s

This commit is contained in:
qiqi committed 2026-12-01 20:45:04 +08:00
1 parent 7833e6c4fe
commit e9d22d235d
5 files changed
+10 -5

No files matched your search

+6 -1
View File
@@ -5983,7 +5983,12 @@ const tbCenterSeed = (type, refs) => {
// 覆盖式替换图片前备份原图:优先保留已有 orig,其次 data,最后 url。返回 updateNode patch。
function origImagePatch(prev, dataUrl) {
const orig = (prev && prev.orig) || (prev && typeof prev.data === 'string' && /^data:/i.test(prev.data) ? prev.data : '') || (prev && typeof prev.url === 'string' ? prev.url : '')
return orig ? { data: String(dataUrl), url: '', orig } : { data: String(dataUrl), url: '' }
// v3.26.175:覆盖式替换必须**同时清掉 localRef / ref**。
// 节点体的取图优先级是 localRef → data → url,旧实现只改 data,
// 于是旧的本地引用(及其缓存的 objectURL)一直赢,新图不显示;
// 直到用户点「立即回收内存」把引用缓存清空,才轮到 data 露出来。
const base = { data: String(dataUrl), url: '', localRef: null, ref: null }
return orig ? Object.assign(base, { orig }) : base
}
function Workbench() {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.26.174",
"version": "3.26.175",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
+1 -1
View File
@@ -2014,7 +2014,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.26.173"
version = "3.26.174"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.26.174"
version = "3.26.175"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.26.174",
"version": "3.26.175",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",