From 8c9a6da41eeea865c8408a29fe0b1027eb21a59b Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Sat, 31 Oct 2026 23:58:12 +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=E6=92=A4=E9=94=80=E9=87=8D=E5=81=9A=E6=97=B6?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E6=A1=86=E9=97=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index b3d761e..22a89ff 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -7140,6 +7140,7 @@ async function openDocument(options = {}) { renderFontList(); } options.keepPreview ? setBusy(true) : setBusy(true, "正在打开文档", 20, STATUS.opening); + let details; try { if (!options.keepPreview) { setProgress("正在解析文档", 52); @@ -7206,6 +7207,12 @@ async function openDocument(options = {}) { if (options.keepPreview) { pageView.resetPageLoading(); state.pageCache.clear(); + if (state.editing) { + const prepared = await callWASM("ofdgoDocumentInfo").catch(err => ({ detailsError: err.message })); + if (openSeq !== state.openSeq) return; + details = prepared.detailsError ? null : prepared; + Object.assign(doc, { detailsPending: false, detailsError: "" }, prepared); + } if (thumbnailPreviews) { for (const page of doc.pages) { const preview = thumbnailPreviews.get(page.id); @@ -7266,7 +7273,7 @@ async function openDocument(options = {}) { canvasEditor.focus(); } pageView.queueNearbyPages(pageIndex, openSeq); - loadDocumentDetails(openSeq); + loadDocumentDetails(openSeq, details); if (page && options.activateActions) { state.openActionEnabled = true; state.openActionDocument = !state.editing;