Skip to content

Commit

Permalink
fix some corner cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Yubin committed Nov 17, 2016
1 parent b2386bd commit a4d9ac0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion addon/core/transition-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ prototype.routeFinishedSetup = function routeFinishedSetup(route) {
};

prototype._viewAdded = function _viewAdded(view, index) {
this._lastActivatedRoute.views.push(index);
if (this._lastActivatedRoute && this._lastActivatedRoute.views) {
this._lastActivatedRoute.views.push(index);
}
};

export default TransitionData;
7 changes: 5 additions & 2 deletions addon/services/ember-perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ export default Base.extend(Evented, {
destRoute: transitionRoute
});
transitionInfo.promise.then(() => {
this.transitionData.finish();
}).catch(() => {
}).finally(() => {
let event = this.transitionData;

scheduleOnce('afterRender', () => {
this.trigger('transitionComplete', event);
this.transitionData.finish();
});
});
},
Expand Down Expand Up @@ -179,4 +182,4 @@ export default Base.extend(Evented, {
console.groupEnd();
}
})
});
});

0 comments on commit a4d9ac0

Please sign in to comment.