From fbb77d3e55240a9616d73994d4f6e8234aecf09b Mon Sep 17 00:00:00 2001 From: parsehex <1779937+parsehex@users.noreply.github.com> Date: Sat, 17 Aug 2019 02:49:08 -0400 Subject: [PATCH] List note titles in delete confirmation (#619) * list note titles in delete confirmation * typo --- src/public/javascripts/services/branches.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/public/javascripts/services/branches.js b/src/public/javascripts/services/branches.js index dbcda42cf..b9539d488 100644 --- a/src/public/javascripts/services/branches.js +++ b/src/public/javascripts/services/branches.js @@ -83,7 +83,14 @@ async function moveToNode(nodesToMove, toNode) { async function deleteNodes(nodes) { nodes = await filterRootNote(nodes); - if (nodes.length === 0 || !await confirmDialog.confirm('Are you sure you want to delete select note(s) and all the sub-notes?')) { + if (nodes.length === 0) { + return false; + } + + const nodeTitles = nodes.map((node) => node.title); + const confirmText = 'This will delete the following notes and their sub-notes: ' + nodeTitles.join(', '); + + if (!await confirmDialog.confirm(confirmText)) { return false; }