diff --git a/app/src/history/diff.ts b/app/src/history/diff.ts index 3be880a9c..2b51133a4 100644 --- a/app/src/history/diff.ts +++ b/app/src/history/diff.ts @@ -80,6 +80,7 @@ const renderCompare = (app: App, element: HTMLElement) => { leftElement.classList.remove("fn__none"); const textElement = leftElement.querySelector("textarea"); const type = pathPosix().extname(response.data.content).toLowerCase(); + const titleElement = leftElement.querySelector(".protyle-title__input"); if (Constants.SIYUAN_ASSETS_IMAGE.concat(Constants.SIYUAN_ASSETS_AUDIO).concat(Constants.SIYUAN_ASSETS_VIDEO).includes(type)) { textElement.previousElementSibling.innerHTML = renderAssetsPreview(response.data.content); textElement.previousElementSibling.classList.remove("fn__none"); @@ -101,6 +102,7 @@ const renderCompare = (app: App, element: HTMLElement) => { action: [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML], }); } + titleElement.textContent = response.data.title; leftElement.querySelector(".history__date").textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm"); }); const id2 = element.getAttribute("data-id2"); @@ -109,6 +111,7 @@ const renderCompare = (app: App, element: HTMLElement) => { fetchPost("/api/repo/openRepoSnapshotDoc", {id: id2}, (response) => { const textElement = rightElement.querySelector("textarea"); const type = pathPosix().extname(response.data.content).toLowerCase(); + const titleElement = rightElement.querySelector(".protyle-title__input"); if (Constants.SIYUAN_ASSETS_IMAGE.concat(Constants.SIYUAN_ASSETS_AUDIO).concat(Constants.SIYUAN_ASSETS_VIDEO).includes(type)) { textElement.previousElementSibling.innerHTML = renderAssetsPreview(response.data.content); textElement.previousElementSibling.classList.remove("fn__none"); @@ -130,6 +133,7 @@ const renderCompare = (app: App, element: HTMLElement) => { action: [Constants.CB_GET_HISTORY, Constants.CB_GET_HTML], }); } + titleElement.textContent = response.data.title; rightElement.querySelector(".history__date").textContent = dayjs(response.data.updated).format("YYYY-MM-DD HH:mm"); }); } else { @@ -262,12 +266,14 @@ const genHTML = (left: string, right: string, dialog: Dialog, direct: string) =>