Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/5845

Vanessa0577c4084401
diff --git a/app/src/util/history.ts b/app/src/util/history.ts
index 111f1e4681..ca460ee841 100644
--- a/app/src/util/history.ts
+++ b/app/src/util/history.ts
@@ -64,8 +64,8 @@ const renderDoc = (element: HTMLElement, currentPage: number) => {
</li>`;
if (item.items.length > 0) {
logsHTML += `<ul class="${index === 0 ? "" : "fn__none"}">`;
- item.items.forEach((docItem, docIndex) => {
- logsHTML += `<li title="${escapeHtml(docItem.title)}" data-type="${typeElement.value === "1" ? "assets" : "doc"}" data-path="${docItem.path}" class="b3-list-item b3-list-item--hide-action${(index === 0 && docIndex === 0) ? " b3-list-item--focus" : ""}" style="padding-left: 32px">
+ item.items.forEach((docItem) => {
+ logsHTML += `<li title="${escapeHtml(docItem.title)}" data-type="${typeElement.value === "1" ? "assets" : "doc"}" data-path="${docItem.path}" class="b3-list-item b3-list-item--hide-action" style="padding-left: 32px">
<span class="b3-list-item__text">${escapeHtml(docItem.title)}</span>
<span class="fn__space"></span>
<span class="b3-list-item__action b3-tooltips b3-tooltips__w" data-type="rollback" aria-label="${window.siyuan.languages.rollback}">
@@ -74,26 +74,6 @@ const renderDoc = (element: HTMLElement, currentPage: number) => {
</li>`;
});
logsHTML += "</ul>";
- if (index === 0) {
- if (typeElement.value === "1") {
- assetElement.innerHTML = renderAssetsPreview(item.items[0].path);
- } else {
- fetchPost("/api/history/getDocHistoryContent", {
- historyPath: item.items[0].path,
- k: inputElement.value
- }, (contentResponse) => {
- if (contentResponse.data.isLargeDoc) {
- mdElement.value = contentResponse.data.content;
- mdElement.classList.remove("fn__none");
- docElement.classList.add("fn__none");
- } else {
- mdElement.classList.add("fn__none");
- docElement.classList.remove("fn__none");
- onGet(contentResponse, historyEditor.protyle, [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML]);
- }
- });
- }
- }
}
});
element.lastElementChild.firstElementChild.innerHTML = logsHTML;