Skip to content

Commit 434dddc

Browse files
committed
Better handling of concurrent prompts issues (thanks billarbor for reporting).
1 parent 34c0698 commit 434dddc

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/ui/Prompts.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ var Prompts = (() => {
8888
this.done = () => {};
8989
winMan.close();
9090
resolve(this.result);
91-
if (backlog.length) {
92-
winMan.open(backlog.shift());
93-
} else {
91+
if (promptData === this) {
9492
promptData = null;
93+
if (backlog.length) {
94+
winMan.open(backlog.shift());
95+
}
9596
}
9697
}
9798
};

src/ui/prompt.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
.forEach(p => window[p] = bg[p]);
66
let data = Prompts.promptData;
77
debug(data);
8+
if (!data) {
9+
error("Missing promptData");
10+
window.close();
11+
return;
12+
}
813
let {title, message, options, checks, buttons} = data.features;
914

1015
function labelFor(el, text) {

0 commit comments

Comments
 (0)