Skip to content

Commit 4fabade

Browse files
committed
fix(nav): immediately stop if view removed before trans finished
1 parent 22ec464 commit 4fabade

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

ionic/components/nav/nav-controller.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -692,31 +692,14 @@ export class NavController extends Ion {
692692
if (forcedActive) {
693693
// this scenario happens when a remove is going on
694694
// during a transition
695-
let resolve;
696-
let promise = new Promise(res => { resolve = res; });
697-
698-
if (!opts.animation) {
699-
opts.animation = forcedActive.getTransitionName(opts.direction);
700-
}
701-
702695
if (this._trans) {
703-
this._trans
704-
.onFinish(() => {
705-
opts.animate = false;
706-
this._transition(forcedActive, null, opts, (hasCompleted: boolean) => {
707-
// transition has completed!!
708-
resolve(hasCompleted);
709-
});
710-
}, false, true)
711-
.stop();
696+
this._trans.stop();
712697
this._trans.destroy();
713698
this._trans = null;
714-
715-
} else {
716-
resolve(false);
699+
this._cleanup();
717700
}
718701

719-
return promise;
702+
return Promise.resolve(false);
720703
}
721704
}
722705

0 commit comments

Comments
 (0)