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;