mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
Compare commits
No commits in common. "9b9233f192cbb76388023aaa7629d4b4bd83cc75" and "986b5979b94609c7b38fbd0e1ac51c4b08e04215" have entirely different histories.
9b9233f192
...
986b5979b9
2 changed files with 10 additions and 17 deletions
|
@ -253,8 +253,6 @@ export default {
|
||||||
clearFilters() {
|
clearFilters() {
|
||||||
this.$emit("updateFilter", {
|
this.$emit("updateFilter", {
|
||||||
status: [],
|
status: [],
|
||||||
active: [],
|
|
||||||
tags: [],
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getExistingTags(callback) {
|
getExistingTags(callback) {
|
||||||
|
|
|
@ -199,24 +199,19 @@ const router = createRouter({
|
||||||
});
|
});
|
||||||
|
|
||||||
router.beforeEach((to, from) => {
|
router.beforeEach((to, from) => {
|
||||||
|
// If the path is same, either the query or has has changed so avoid changing query params
|
||||||
|
// Without this check, modifying any query params will be blocked
|
||||||
// Check if redirectedFrom is defined to check if this function has already been run
|
// Check if redirectedFrom is defined to check if this function has already been run
|
||||||
// Without this check, the router will be stuck in an infinite loop
|
// Without this check, the router will be stuck in an infinite loop
|
||||||
if (to.redirectedFrom) {
|
if (to.fullPath !== from.fullPath && !to.redirectedFrom) {
|
||||||
return;
|
return {
|
||||||
|
...to,
|
||||||
|
query: {
|
||||||
|
...to.query,
|
||||||
|
...from.query,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user is navigating to same page but to.query is empty, they have clicked on the same link
|
|
||||||
// For example: Clicked on Add monitor twice
|
|
||||||
if (to.path === from.path && Object.keys(to.query).length !== 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
...to,
|
|
||||||
query: {
|
|
||||||
...to.query,
|
|
||||||
...from.query,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export { router };
|
export { router };
|
||||||
|
|
Loading…
Reference in a new issue