1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fire the route cancel event only when needed. (#1316)

Earlier we do it for every route change.
This commit is contained in:
Arunoda Susiripala 2017-03-01 00:29:20 +05:30 committed by Tim Neutkens
parent 96fca5e2ad
commit 46b5d6a445

View file

@ -329,8 +329,8 @@ export default class Router extends EventEmitter {
}
abortComponentLoad (as) {
this.emit('routeChangeError', new Error('Route Cancelled'), as)
if (this.componentLoadCancel) {
this.emit('routeChangeError', new Error('Route Cancelled'), as)
this.componentLoadCancel()
this.componentLoadCancel = null
}