Compare commits

..

1 commit

Author SHA1 Message Date
Suven-p
2950482ba4
Merge 986b5979b9 into 8a432ac937 2024-11-15 06:51:22 +05:45
2 changed files with 10 additions and 17 deletions

View file

@ -253,8 +253,6 @@ export default {
clearFilters() {
this.$emit("updateFilter", {
status: [],
active: [],
tags: [],
});
},
getExistingTags(callback) {

View file

@ -199,17 +199,11 @@ 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.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;
}
if (to.fullPath !== from.fullPath && !to.redirectedFrom) {
return {
...to,
query: {
@ -217,6 +211,7 @@ router.beforeEach((to, from) => {
...from.query,
},
};
}
});
export { router };