mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
web/DialogContainer: prevent an error after a race condition
an error is no longer thrown if several dialogs were closed while timeout was running this should really be replaced by proper dialog management system, with each dialog having a unique id and removal happening via that id, not just array.pop()
This commit is contained in:
parent
5850b1ac87
commit
93ff9b62d6
@ -16,9 +16,14 @@
|
||||
if (dialogParent) {
|
||||
closing = true;
|
||||
open = false;
|
||||
|
||||
// wait 150ms for the closing animation to finish
|
||||
setTimeout(() => {
|
||||
dialogParent.close();
|
||||
killDialog();
|
||||
// check if dialog parent is still present
|
||||
if (dialogParent) {
|
||||
dialogParent.close();
|
||||
killDialog();
|
||||
}
|
||||
}, 150);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user