From 60a2d67a8245870e4140b89a87472cc5f40c7f09 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 10 Nov 2025 17:11:11 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/render/av/render.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index dea75499b..a5cf90f4f 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -443,7 +443,7 @@ const afterRenderTable = (options: ITableOptions) => { }); }; -export const avRender = async (element: Element, protyle: IProtyle, cb?: (data: IAV) => void, renderAll = true, data?: IAV) => { +export const avRender = async (element: Element, protyle: IProtyle, cb?: (data: IAV) => void, renderAll = true, avData?: IAV) => { let avElements: Element[] = []; if (element.getAttribute("data-type") === "NodeAttributeView") { // 编辑器内代码块编辑渲染 @@ -544,7 +544,8 @@ export const avRender = async (element: Element, protyle: IProtyle, cb?: (data: const created = protyle.options.history?.created; const snapshot = protyle.options.history?.snapshot; const avPageSize = getPageSize(e); - if (!data) { + let data: IAV; + if (!avData) { const response = await fetchSyncPost(created ? "/api/av/renderHistoryAttributeView" : (snapshot ? "/api/av/renderSnapshotAttributeView" : "/api/av/renderAttributeView"), { id: e.getAttribute("data-av-id"), created, @@ -556,6 +557,8 @@ export const avRender = async (element: Element, protyle: IProtyle, cb?: (data: blockID: e.getAttribute("data-node-id"), }); data = response.data; + } else { + data = avData; } if (data.viewType === "gallery") { e.setAttribute("data-av-type", data.viewType);