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)
{
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();
}
}
}
}