Skip to content

Commit d1858f8

Browse files
author
Alexander Vakrilov
authored
fix: handle fake attach after FragMgr is destroyed (#8200)
1 parent 76442f4 commit d1858f8

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,14 @@ export class BottomNavigation extends TabNavigationBase {
385385

386386
_onAttachedToWindow(): void {
387387
super._onAttachedToWindow();
388-
this._attachedToWindow = true;
389388

390389
// _onAttachedToWindow called from OS again after it was detach
391390
// TODO: Consider testing and removing it when update to androidx.fragment:1.2.0
392391
if (this._manager && this._manager.isDestroyed()) {
393392
return;
394393
}
395-
394+
395+
this._attachedToWindow = true;
396396
this.changeTab(this.selectedIndex);
397397
}
398398

‎nativescript-core/ui/frame/frame.android.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ export class Frame extends FrameBase {
150150

151151
_onAttachedToWindow(): void {
152152
super._onAttachedToWindow();
153-
this._attachedToWindow = true;
154-
153+
155154
// _onAttachedToWindow called from OS again after it was detach
156155
// TODO: Consider testing and removing it when update to androidx.fragment:1.2.0
157156
if (this._manager && this._manager.isDestroyed()) {
158157
return;
159158
}
160-
159+
160+
this._attachedToWindow = true;
161161
this._processNextNavigationEntry();
162162
}
163163

0 commit comments

Comments
 (0)