Skip to content

Commit c55ab1f

Browse files
committed
chore: Making onLoaded less busy
1 parent 07f3a16 commit c55ab1f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

packages/core/ui/frame/frame-common.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,9 @@ export class FrameBase extends CustomLayoutView {
122122
@profile
123123
public onLoaded() {
124124
const parentFrame = this.page?.frame;
125-
let pendingFrame: FrameBase;
125+
// Pending frame can be the first frame in the view tree or a nested frame
126+
const pendingFrame = parentFrame && parentFrame.isLoadingSubviews ? parentFrame : this;
126127

127-
// This frame is a nested frame as it resides inside the Page view of another frame
128-
if (parentFrame && parentFrame.isLoadingSubviews) {
129-
pendingFrame = parentFrame;
130-
} else {
131-
pendingFrame = this;
132-
}
133-
134-
// Process the entry of a nested frame once its parent has been loaded
135-
// or wait for it to be loaded in case it's not nested inside another frame
136128
pendingFrame.once(FrameBase.loadedEvent, () => {
137129
this.onFrameLoaded();
138130
});

0 commit comments

Comments
 (0)