Change OverlayManager.open
to always error if the overlay is already active
The old code would allow an overlay to force close *itself*, before immediately re-opening itself, which actually isn't very helpful in practice since that won't re-run any overlay-specific initialization code. Given how the overlays are being used this really shouldn't have caused any issues, but it's a bug that we should fix nonetheless.
This commit is contained in:
parent
bace0623e5
commit
cd133dbcac
@ -80,10 +80,10 @@ class OverlayManager {
|
||||
if (!this.#overlays[name]) {
|
||||
throw new Error("The overlay does not exist.");
|
||||
} else if (this.#active) {
|
||||
if (this.#overlays[name].canForceClose) {
|
||||
this.#closeThroughCaller();
|
||||
} else if (this.#active === name) {
|
||||
if (this.#active === name) {
|
||||
throw new Error("The overlay is already active.");
|
||||
} else if (this.#overlays[name].canForceClose) {
|
||||
this.#closeThroughCaller();
|
||||
} else {
|
||||
throw new Error("Another overlay is currently active.");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user