-
Notifications
You must be signed in to change notification settings - Fork 12
Disable Buttons to Prevent Multiple Requests #167
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
Disable Buttons to Prevent Multiple Requests #167
Conversation
| "pinia": "^2.1.7", | ||
| "vee-validate": "^4.12.4", | ||
| "vue": "^3.4.13", | ||
| "vite-plugin-pages": "^0.32.2", |
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.
Can this dependency be removed? The plugin itself does not seem to be used.
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.
I added it because, when I ran 'npm typecheck', I got an error stating that vite-plugin-pages was not found.
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.
Its because vite-plugin-pages/client in
Contexture/frontend-vue/tsconfig.json
Line 17 in 55a65f5
| "types": ["vite/client", "vite-plugin-pages/client", "unplugin-icons/types/vue", "@fuse-open/types"], |
| animation: dotSpin var(--duration) linear calc(var(--delay) * 0.155s) infinite alternate; | ||
| } | ||
| @keyframes dotSpin { |
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.
I think its fine to keep the animation part of the component. You could however extend the tailwind configuration and introduce this specific animation if we would reuse it somewhere else.
| @@ -0,0 +1,57 @@ | |||
| <template> | |||
| <div v-if="isLoading"> | |||
| <div class="loader"> | |||
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.
I would prefer to use the utility classes from tailwind to keep the css consistent.
You can rewrite it with
inline-grid grid-flow-col w-full place-content-center justify-self-center
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.
I would create a separate "component" for it and put it into primitives directly instead of making it part of the button. I think it can be reused not only with button.
This PR introduces changes to disable UI buttons temporarily to prevent users from sending multiple requests unintentionally. Specifically, the changes address an issue where users could trigger the same action multiple times by repeatedly clicking a button before the initial request is completed.
The issue was causing multiple identical requests to be sent, leading to redundant server calls and potential data processing errors.