mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Compare commits
5 commits
2950482ba4
...
01340c5e55
Author | SHA1 | Date | |
---|---|---|---|
|
01340c5e55 | ||
|
9b9233f192 | ||
|
754254c4b1 | ||
|
24ffef5d69 | ||
|
7901d7666e |
2 changed files with 17 additions and 10 deletions
|
@ -253,6 +253,8 @@ export default {
|
|||
clearFilters() {
|
||||
this.$emit("updateFilter", {
|
||||
status: [],
|
||||
active: [],
|
||||
tags: [],
|
||||
});
|
||||
},
|
||||
getExistingTags(callback) {
|
||||
|
|
|
@ -199,11 +199,17 @@ const router = createRouter({
|
|||
});
|
||||
|
||||
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
|
||||
// Without this check, the router will be stuck in an infinite loop
|
||||
if (to.fullPath !== from.fullPath && !to.redirectedFrom) {
|
||||
if (to.redirectedFrom) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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: {
|
||||
|
@ -211,7 +217,6 @@ router.beforeEach((to, from) => {
|
|||
...from.query,
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
export { router };
|
||||
|
|
Loading…
Reference in a new issue