mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix: handle fake attach after FragMgr is destroyed (#8200)
This commit is contained in:

committed by
GitHub

parent
76442f433e
commit
d1858f81b7
@ -385,14 +385,14 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
|
||||
_onAttachedToWindow(): void {
|
||||
super._onAttachedToWindow();
|
||||
this._attachedToWindow = true;
|
||||
|
||||
// _onAttachedToWindow called from OS again after it was detach
|
||||
// TODO: Consider testing and removing it when update to androidx.fragment:1.2.0
|
||||
if (this._manager && this._manager.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this._attachedToWindow = true;
|
||||
this.changeTab(this.selectedIndex);
|
||||
}
|
||||
|
||||
|
@ -150,14 +150,14 @@ export class Frame extends FrameBase {
|
||||
|
||||
_onAttachedToWindow(): void {
|
||||
super._onAttachedToWindow();
|
||||
this._attachedToWindow = true;
|
||||
|
||||
|
||||
// _onAttachedToWindow called from OS again after it was detach
|
||||
// TODO: Consider testing and removing it when update to androidx.fragment:1.2.0
|
||||
if (this._manager && this._manager.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this._attachedToWindow = true;
|
||||
this._processNextNavigationEntry();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user