mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🐛 数据重复
This commit is contained in:
parent
f1bcf566ab
commit
60a2d67a82
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue