From: Eduardo San Martin Morote Date: Sat, 10 Aug 2019 21:31:54 +0000 (+0200) Subject: fix: trigger errors in scrollBehavior X-Git-Tag: v4.0.0-alpha.0~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38e7ac72136060e6373ae0966b40f307fa221df4;p=thirdparty%2Fvuejs%2Frouter.git fix: trigger errors in scrollBehavior --- diff --git a/src/router.ts b/src/router.ts index a9f383ea..7180b6de 100644 --- a/src/router.ts +++ b/src/router.ts @@ -94,7 +94,9 @@ export class Router { ...matchedRoute, } this.updateReactiveRoute() - this.handleScroll(toLocation, this.pendingLocation) + this.handleScroll(toLocation, this.currentRoute).catch(err => + this.triggerError(err, false) + ) } catch (error) { if (NavigationGuardRedirect.is(error)) { // TODO: refactor the duplication of new NavigationCancelled by @@ -283,6 +285,9 @@ export class Router { const from = this.currentRoute this.currentRoute = toLocation this.updateReactiveRoute() + this.handleScroll(toLocation, from).catch(err => + this.triggerError(err, false) + ) // navigation is confirmed, call afterGuards for (const guard of this.afterGuards) guard(toLocation, from)