mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
fix(ViewController): nav must be set as soon as possible
fixes regression in 5a4c6093a72059577544dafe372e06018ee1ed19 fixes #10654
This commit is contained in:
@ -775,7 +775,7 @@ export class NavControllerBase extends Ion implements NavController {
|
||||
assert(view._nav === this, 'view is not part of the nav');
|
||||
this._views.splice(index, 0, this._views.splice(existingIndex, 1)[0]);
|
||||
} else {
|
||||
assert(!view._nav, 'nav is used');
|
||||
assert(!view._nav || (this._isPortal && view._nav === this), 'nav is used');
|
||||
// this is a new view to add to the stack
|
||||
// create the new entering view
|
||||
view._setNav(this);
|
||||
|
@ -165,6 +165,7 @@ export class ViewController {
|
||||
*/
|
||||
dismiss(data?: any, role?: any, navOptions: NavOptions = {}): Promise<any> {
|
||||
if (!this._nav) {
|
||||
assert(this._state === ViewState.DESTROYED, 'ViewController does not have a valid _nav');
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
if (this.isOverlay && !navOptions.minClickBlockDuration) {
|
||||
|
Reference in New Issue
Block a user