rollbacked: use simpler confirm instead on promise-based function

This commit is contained in:
quenousimporte 2023-02-02 08:43:30 +01:00
parent aa198d6b56
commit da8bb40160
1 changed files with 5 additions and 10 deletions

15
main.js
View File

@ -426,25 +426,20 @@ function includesub()
if (range) if (range)
{ {
var title = linkatpos(); var title = linkatpos();
ask("Replace [[" + title + "]] by its content?") if confirm("Replace [[" + title + "]] by its content?")
.then( (answser) =>
{ {
if (answser != "Yes") return;
var subnote = getnote(title); var subnote = getnote(title);
md.value = md.value =
md.value.substring(0, range.start) md.value.substring(0, range.start)
+ subnote.content + subnote.content
+ md.value.substring(range.end); + md.value.substring(range.end);
ask("Delete '" + title + "'?") if confirm("Delete '" + title + "'?")
.then( (answser) =>
{ {
if (answser != "Yes") return;
deletenote(subnote); deletenote(subnote);
}) datachanged();
.finally(datachanged); }
}); }
} }
} }