perf: Improved live-sync functionality for RootLayout (#9836)

This commit is contained in:
Dimitris - Rafail Katsampas
2022-04-07 05:03:16 +03:00
committed by GitHub
parent 11eb705433
commit 3537858b6d
2 changed files with 15 additions and 6 deletions

View File

@@ -194,12 +194,6 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
let handled = false;
const rootLayout = global.rootLayout;
if (rootLayout != null && rootLayout.topmost() != null) {
rootLayout.closeAll();
handled = true;
}
if (this._closeAllModalViewsInternal()) {
handled = true;
}

View File

@@ -25,6 +25,21 @@ export class RootLayoutBase extends GridLayout {
super.onLoaded();
}
public _onLivesync(context?: ModuleContext): boolean {
let handled = false;
if (this.popupViews.length > 0) {
this.closeAll();
handled = true;
}
if (super._onLivesync(context)) {
handled = true;
}
return handled;
}
// ability to add any view instance to composite views like layers
open(view: View, options: RootLayoutOptions = {}): Promise<void> {
return new Promise((resolve, reject) => {