From 3306098a0310029b750fd45cea503b924dd661ac Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 20 Jul 2022 11:23:51 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5466 --- app/src/assets/scss/_function.scss | 1 + app/src/util/history.ts | 21 +++++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/assets/scss/_function.scss b/app/src/assets/scss/_function.scss index b58afaa3e..cd9263b60 100644 --- a/app/src/assets/scss/_function.scss +++ b/app/src/assets/scss/_function.scss @@ -165,6 +165,7 @@ padding: 0 8px; font-size: 12px; line-height: 16px; + margin-right: 8px; } } diff --git a/app/src/util/history.ts b/app/src/util/history.ts index fbb89f611..750bca053 100644 --- a/app/src/util/history.ts +++ b/app/src/util/history.ts @@ -116,22 +116,23 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string let repoHTML = ""; response.data.snapshots.forEach((item: { memo: string, id: string, hCreated: string, count: number, hSize: string, tag: string }) => { if (isMobile()) { - repoHTML += `
  • + repoHTML += `
  • + ${escapeHtml(item.memo)} ${item.tag} - ${item.hCreated} - ${item.hSize} - - ${actionHTML}
    - ${escapeHtml(item.memo)} +
    + ${item.hCreated} + ${item.hSize} + ${window.siyuan.languages.fileCount}${item.count} +
    +
    ${actionHTML}
  • `; } else { repoHTML += `
  • ${escapeHtml(item.memo)} - ${item.tag}
    @@ -440,11 +441,7 @@ export const openHistory = () => { const tag = target.parentElement.getAttribute("data-tag"); confirmDialog(window.siyuan.languages.delete, `${window.siyuan.languages.confirmDelete} ${tag}?`, () => { fetchPost("/api/repo/" + type, {tag}, () => { - if (target.parentElement.parentElement.childElementCount === 1) { - target.parentElement.parentElement.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • `; - } else { - target.parentElement.remove(); - } + renderRepo(repoElement, type === "removeRepoTagSnapshot" ? -1 : -2); }); }); break;