Skip to content

Commit b2e3fbd

Browse files
committed
fix: corrected frame new unloaded handling
1 parent 4b023a6 commit b2e3fbd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,14 @@ export class FrameBase extends CustomLayoutView {
144144

145145
@profile
146146
public onUnloaded() {
147+
// Property page refers to the page this frame is nested into
148+
const parentFrame = this.page?.frame;
149+
147150
super.onUnloaded();
148151

149152
// This is a precaution in case the method is called asynchronously during the loading procedure
150-
if (this.hasListeners(FRAME_ENTRY_LOADED_EVENT)) {
151-
this.off(FRAME_ENTRY_LOADED_EVENT);
153+
if (parentFrame && parentFrame.hasListeners(FRAME_ENTRY_LOADED_EVENT)) {
154+
parentFrame.off(FRAME_ENTRY_LOADED_EVENT);
152155
}
153156
}
154157

0 commit comments

Comments
 (0)