loomio/loomio

View on GitHub
vue/src/config/catch_navigation_duplicated.js

Summary

Maintainability
A
0 mins
Test Coverage
import Router from 'vue-router'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}