diff --git a/app/src/history/history.ts b/app/src/history/history.ts index 6ec06f421..098a87991 100644 --- a/app/src/history/history.ts +++ b/app/src/history/history.ts @@ -20,7 +20,6 @@ let historyEditor: Protyle; const renderDoc = (element: HTMLElement, currentPage: number) => { const previousElement = element.querySelector('[data-type="docprevious"]'); const nextElement = element.querySelector('[data-type="docnext"]'); - const pageElement = nextElement.nextElementSibling.nextElementSibling; element.setAttribute("data-page", currentPage.toString()); if (currentPage > 1) { previousElement.removeAttribute("disabled"); @@ -84,8 +83,8 @@ const renderDoc = (element: HTMLElement, currentPage: number) => { } else { nextElement.setAttribute("disabled", "disabled"); } - pageBtn.setAttribute("data-totalPage", (response.data.pageCount || 1).toString()); - // nextElement.nextElementSibling.nextElementSibling.textContent = `${currentPage}/${response.data.pageCount || 1}`; + pageBtn.setAttribute("data-totalpage", (response.data.pageCount || 1).toString()); + const pageElement = nextElement.nextElementSibling.nextElementSibling; pageElement.textContent = `${window.siyuan.languages.pageCountAndHistoryCount.replace("${x}", response.data.pageCount).replace("${y}", response.data.totalCount || 1)}`; pageElement.classList.remove("fn__none"); if (response.data.histories.length === 0) { @@ -280,7 +279,7 @@ const renderRepo = (element: Element, currentPage: number) => { } else { nextElement.setAttribute("disabled", "disabled"); } - pageBtn.setAttribute("data-totalPage", (response.data.pageCount || 1).toString()); + pageBtn.setAttribute("data-totalpage", (response.data.pageCount || 1).toString()); pageElement.textContent = `${window.siyuan.languages.pageCountAndSnapshotCount.replace("${x}", response.data.pageCount).replace("${y}", response.data.totalCount || 1)}`; pageElement.classList.remove("fn__none"); renderRepoItem(response, element, selectValue); @@ -355,7 +354,7 @@ export const openHistory = (app: App) => {