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:
parent
96fca5e2ad
commit
46b5d6a445
|
@ -329,8 +329,8 @@ export default class Router extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
abortComponentLoad (as) {
|
abortComponentLoad (as) {
|
||||||
this.emit('routeChangeError', new Error('Route Cancelled'), as)
|
|
||||||
if (this.componentLoadCancel) {
|
if (this.componentLoadCancel) {
|
||||||
|
this.emit('routeChangeError', new Error('Route Cancelled'), as)
|
||||||
this.componentLoadCancel()
|
this.componentLoadCancel()
|
||||||
this.componentLoadCancel = null
|
this.componentLoadCancel = null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue