From e14b7aa169d4fc7acf4162e24acb262c257a8275 Mon Sep 17 00:00:00 2001 From: GloamXun Date: Tue, 27 Oct 2026 21:19:25 +0800 Subject: [PATCH] Only apply page patches for the actual route-D engine --- app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 455426e..f9a9431 100644 --- a/app.js +++ b/app.js @@ -484,9 +484,12 @@ async function refreshPreview() { state.previewController = controller; setPreviewStatus("排版中…"); try { - const patchMode = state.engine === "route-d"; + const requestedPatch = state.engine === "route-d"; const response = await fetch( - projectPath("/preview") + engineQuery() + "&buffer=1" + (patchMode ? "&patch=1" : ""), + projectPath("/preview") + + engineQuery() + + "&buffer=1" + + (requestedPatch ? "&patch=1" : ""), { method: "POST", headers: { "Content-Type": "text/plain; charset=utf-8" }, @@ -497,6 +500,7 @@ async function refreshPreview() { const actualEngine = response.headers.get("X-Preview-Engine") || (state.engine === "route-d" ? "route-d" : "v1"); + const patchMode = requestedPatch && actualEngine === "route-d"; if (requestId !== state.previewRequest) return; const payload = await response.json(); if (requestId !== state.previewRequest) return;