fix(RootLayout): resilience around shadeCover options

This commit is contained in:
Nathan Walker
2022-07-04 19:33:01 -07:00
parent 4f92354707
commit e5fffa1dad

View File

@@ -114,7 +114,7 @@ export class RootLayoutBase extends GridLayout {
if (this.shadeCover) {
// update shade cover with the topmost popupView options (if not specifically told to ignore)
if (!poppedView?.options?.shadeCover.ignoreShadeRestore) {
if (!poppedView?.options?.shadeCover?.ignoreShadeRestore) {
const shadeCoverOptions = this.popupViews[this.popupViews.length - 1]?.options?.shadeCover;
if (shadeCoverOptions) {
this.updateShadeCover(this.shadeCover, shadeCoverOptions);
@@ -122,7 +122,7 @@ export class RootLayoutBase extends GridLayout {
}
// remove shade cover animation if this is the last opened popup view
if (this.popupViews.length === 0) {
this.closeShadeCover(poppedView.options.shadeCover);
this.closeShadeCover(poppedView?.options?.shadeCover);
}
}