From 85baeda7f917d7da73eea9d66a0e921ea6e62322 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Thu, 22 Oct 2026 23:55:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B3=A8=E8=A7=A3=E5=88=87=E6=8D=A2):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E8=A7=A3=E5=88=87=E6=8D=A2=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index 1eb20fd..f87bbe1 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -5903,17 +5903,22 @@ async function toggleAnnotations() { if (document.body.hasAttribute("data-busy")) { return; } + const tab = documentTab(), state = tab.state; + const previous = state.renderAnnotations; state.renderAnnotations = !state.renderAnnotations; updateAnnotationButton(); if (!state.doc) { return; } - await openDocument({ - pageIndex: state.pageIndex, - fitMode: state.fitMode, - skipAutoFonts: true, - reuseSession: true, - }); + try { + await refreshPageDisplay(); + } catch (err) { + state.renderAnnotations = previous; + if (isForegroundDocument(tab)) { + updateAnnotationButton(); + showError(err, false); + } + } } function displayMode() {