From da8bb40160f424e2203fbc54c785a74b34b72c45 Mon Sep 17 00:00:00 2001 From: quenousimporte <76260127+quenousimporte@users.noreply.github.com> Date: Thu, 2 Feb 2023 08:43:30 +0100 Subject: [PATCH] rollbacked: use simpler confirm instead on promise-based function --- main.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/main.js b/main.js index 9777259..940559d 100644 --- a/main.js +++ b/main.js @@ -426,25 +426,20 @@ function includesub() if (range) { var title = linkatpos(); - ask("Replace [[" + title + "]] by its content?") - .then( (answser) => + if confirm("Replace [[" + title + "]] by its content?") { - if (answser != "Yes") return; - var subnote = getnote(title); md.value = md.value.substring(0, range.start) + subnote.content + md.value.substring(range.end); - ask("Delete '" + title + "'?") - .then( (answser) => + if confirm("Delete '" + title + "'?") { - if (answser != "Yes") return; deletenote(subnote); - }) - .finally(datachanged); - }); + datachanged(); + } + } } }