Better handling of concurrent prompts issues (thanks billarbor for reporting).

This commit is contained in:
hackademix 2020-12-08 23:01:58 +01:00
parent 34c0698e4c
commit 434dddcea0
2 changed files with 9 additions and 3 deletions

View File

@ -88,10 +88,11 @@ var Prompts = (() => {
this.done = () => {};
winMan.close();
resolve(this.result);
if (backlog.length) {
winMan.open(backlog.shift());
} else {
if (promptData === this) {
promptData = null;
if (backlog.length) {
winMan.open(backlog.shift());
}
}
}
};

View File

@ -5,6 +5,11 @@
.forEach(p => window[p] = bg[p]);
let data = Prompts.promptData;
debug(data);
if (!data) {
error("Missing promptData");
window.close();
return;
}
let {title, message, options, checks, buttons} = data.features;
function labelFor(el, text) {