frontend: enforce valid overlays in overlaystore

This commit is contained in:
hippoz 2022-05-08 22:05:58 +03:00
parent 200f1005b9
commit ec7de22dca
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -301,11 +301,14 @@ class OverlayStore extends Store {
toast: null,
login: null,
createAccount: null,
settings: null
editMessage: null,
settings: null,
}, "OverlayStore");
}
open(name, props={}) {
if (this.value[name] === undefined)
throw new Error(`OverlayStore.open: tried to open unknown overlay with name '${name}' (undefined in overlay map)`);
this.value[name] = props;
this.updated();
}