-
Notifications
You must be signed in to change notification settings - Fork 0
fix: fix filters reset #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the filters reset functionality in the UniversalSearchInput component by improving state management and preventing unnecessary filter updates during initialization.
- Removes automatic list refresh after filter updates to prevent conflicts
- Adds logic to restore universal search filter value from URL query parameters on component mount
- Implements a blocking mechanism to prevent filter updates during initialization and manual clearing
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| return { | ||
| field, | ||
| operator, | ||
| value: JSON.parse(decodeURIComponent(route.query[k] as string)) |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON.parse operation could throw an error if the query parameter contains invalid JSON. Consider wrapping it in a try-catch block or validating the input before parsing.
| return { | |
| field, | |
| operator, | |
| value: JSON.parse(decodeURIComponent(route.query[k] as string)) | |
| let value; | |
| try { | |
| value = JSON.parse(decodeURIComponent(route.query[k] as string)); | |
| } catch (e) { | |
| value = undefined; // or '' if you prefer empty string | |
| } | |
| return { | |
| field, | |
| operator, | |
| value |
| const props = defineProps<{ meta?: any; resource?: any; adminUser?: any }>(); | ||
| const localValue = ref(''); | ||
| let t: any = null; | ||
| let blockFilterUpdate = false; |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The blockFilterUpdate variable uses let but could be a ref() for better Vue 3 reactivity consistency with the rest of the component's reactive state.
No description provided.