Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix: warning when navigating to current route again (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley authored Feb 26, 2020
1 parent 627ab74 commit 69c5698
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/renderer/router/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import Vue from 'vue'
import Router from 'vue-router'

const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
return originalPush.call(this, location).catch(error => {
if (error.name !== 'NavigationDuplicated') {
throw error
}
})
}

Vue.use(Router)

// NOTE: when adding a route here, check the `KeepAliveRoutes` computed property
Expand Down

0 comments on commit 69c5698

Please sign in to comment.