From b06df462ea02d1f186f3b889b17c684b1c5eab43 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Mon, 19 Oct 2026 09:07:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98=E8=BE=B9=E7=95=8C=E5=B9=B6?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=B7=A5=E5=85=B7=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.css | 8 ++++---- assets/webui/ofdgo.js | 4 ++++ assets/webui/ofdgo_wasm.js | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/assets/webui/ofdgo.css b/assets/webui/ofdgo.css index 43ed82d..9629968 100644 --- a/assets/webui/ofdgo.css +++ b/assets/webui/ofdgo.css @@ -579,11 +579,11 @@ button:not(:disabled):hover { } .close-icon { - mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 5 14 14M19 5 5 19'/%3E%3C/svg%3E") center / contain no-repeat; + mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 3 18 18M21 3 3 21'/%3E%3C/svg%3E") center / contain no-repeat; } .new-icon { - mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v16M4 12h16'/%3E%3C/svg%3E") center / contain no-repeat; + mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M3 12h18'/%3E%3C/svg%3E") center / contain no-repeat; } .save-icon { @@ -591,7 +591,7 @@ button:not(:disabled):hover { } .edit-icon { - mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 4 5 5M3 21l2-7L16 3a2 2 0 0 1 5 5L10 19Z'/%3E%3C/svg%3E") center / contain no-repeat; + mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 5 5 5M3 21l2-7L15 4a3.5 3.5 0 0 1 5 5L10 19Z'/%3E%3C/svg%3E") center / contain no-repeat; } .save-as-icon { @@ -603,7 +603,7 @@ button:not(:disabled):hover { } .pages-icon { - mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16M4 12h16M4 19h16'/%3E%3C/svg%3E") center / contain no-repeat; + mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h18M3 12h18M3 21h18'/%3E%3C/svg%3E") center / contain no-repeat; } .info-icon { diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index 749f9ec..7875fb2 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -8714,6 +8714,10 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value, const writer = await file.createWritable(); try { await writer.write(result.blob); + if (destination?.saveStamp) { + const current = await file.getFile(); + if (current.size !== destination.saveStamp.size || current.lastModified !== destination.saveStamp.modified) throw new Error("文件已被修改,请另存"); + } await writer.close(); } catch (error) { await writer.abort().catch(() => {}); diff --git a/assets/webui/ofdgo_wasm.js b/assets/webui/ofdgo_wasm.js index 6918377..ab1c8df 100644 --- a/assets/webui/ofdgo_wasm.js +++ b/assets/webui/ofdgo_wasm.js @@ -282,7 +282,6 @@ async function handleMessage({ id, name, args }) { signal?.throwIfAborted(); const result = typeof payload === "string" ? JSON.parse(payload) : payload; if (signal && !importing && !converting && !resources && result.ok) { - operations.delete(id); result.data.size = size; if (name !== "ofdgoExportMedia") self.postMessage({ id, type: "export", stage: "save" }); if (output) { @@ -290,6 +289,8 @@ async function handleMessage({ id, name, args }) { const current = await saveFile.getFile(); if (current.size !== saveStamp.size || current.lastModified !== saveStamp.modified) throw new Error("文件已被修改,请另存"); } + signal.throwIfAborted(); + operations.delete(id); await output.close(); } else { result.data.blob = new Blob(chunks, { type: result.data.mime });