From 6ecf512a73bd4f647a48d01a3e2979938b3e7478 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 6 Jul 2022 09:09:51 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/5332 --- app/src/util/history.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/util/history.ts b/app/src/util/history.ts index e533c2e20..e53ffdf77 100644 --- a/app/src/util/history.ts +++ b/app/src/util/history.ts @@ -432,14 +432,15 @@ export const openHistory = () => { }); break; } else if (type === "removeRepoTagSnapshot" || type === "removeCloudRepoTagSnapshot") { - fetchPost("/api/repo/" + type, { - tag: target.parentElement.getAttribute("data-tag") - }, () => { - if (target.parentElement.parentElement.childElementCount === 1) { - target.parentElement.parentElement.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • ` - } else { - target.parentElement.remove(); - } + 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(); + } + }); }); } else if (type === "uploadSnapshot") { fetchPost("/api/repo/uploadCloudSnapshot", {