Fixed routes forcing a page refresh on navigation

This commit is contained in:
Stefan Zermatten
2020-09-28 10:37:53 +02:00
parent 8b30c7b6d0
commit 3fdb9f79bd

View File

@@ -13,6 +13,17 @@ Router.plugin("ensureSignedIn", {
]
});
if (Meteor.isClient){
document.addEventListener(`click`, e => {
const origin = e.target.closest("a");
if (origin && Router.findFirstRoute(origin.href)) {
Router.go(origin.href);
e.preventDefault();
}
});
}
Router.plugin("dataNotFound", {notFoundTemplate: "notFound"});
var handleSubError = function(e){