]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix: trigger errors in scrollBehavior
authorEduardo San Martin Morote <posva13@gmail.com>
Sat, 10 Aug 2019 21:31:54 +0000 (23:31 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Sat, 10 Aug 2019 21:31:54 +0000 (23:31 +0200)
src/router.ts

index a9f383ea91208b3e827be59d193c7d095b79ed04..7180b6de7d632798713f17eb089b87e745e0bf80 100644 (file)
@@ -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)