Only apply page patches for the actual route-D engine
This commit is contained in:
1 parent
b7b6c65684
commit
e14b7aa169
1 file changed
+6
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user