Skip to content

Commit

Permalink
fix(nav): immediately stop if view removed before trans finished
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Feb 21, 2016
1 parent 22ec464 commit 4fabade
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions ionic/components/nav/nav-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,31 +692,14 @@ export class NavController extends Ion {
if (forcedActive) {
// this scenario happens when a remove is going on
// during a transition
let resolve;
let promise = new Promise(res => { resolve = res; });

if (!opts.animation) {
opts.animation = forcedActive.getTransitionName(opts.direction);
}

if (this._trans) {
this._trans
.onFinish(() => {
opts.animate = false;
this._transition(forcedActive, null, opts, (hasCompleted: boolean) => {
// transition has completed!!
resolve(hasCompleted);
});
}, false, true)
.stop();
this._trans.stop();
this._trans.destroy();
this._trans = null;

} else {
resolve(false);
this._cleanup();
}

return promise;
return Promise.resolve(false);
}
}

Expand Down

0 comments on commit 4fabade

Please sign in to comment.