Only apply page patches for the actual route-D engine

This commit is contained in:
gloamxun committed 2026-10-27 21:19:25 +08:00
1 parent b7b6c65684
commit e14b7aa169
1 file changed
+6 -2
+6 -2
View File
@@ -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;