Skip to content
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 Upload Button After Successful Upload to Prevent Duplicate Submissions #12

Open
dahifi opened this issue Feb 1, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dahifi
Copy link
Contributor

dahifi commented Feb 1, 2024

Summary:

Currently, users can click the upload button multiple times, leading to an error indicating that the service account does not have delete permissions needed to overwrite the existing file. We should prevent users from uploading a file after a successful upload.

Proposed Solution:

Implement a state management solution within the AudioUploader component to disable the upload button upon the successful upload of a file. This state should be reset only when a new file is selected or under specific user actions that explicitly indicate the intent to upload a different file.

Implementation Details:

  • Introduce a new state variable, e.g., isUploadSuccessful, to track the upload status.
  • Upon a successful file upload, set this state to true, which should disable the upload button and optionally provide user feedback indicating that the upload was successful.
  • Add logic to reset this state to false when a user selects a new file or performs an action indicating readiness for a new upload (e.g., clicking a "New Upload" button or changing the file in the input field).
  • Ensure the UI clearly communicates to the user why the upload button is disabled if it is in the disabled state, to avoid confusion.

Expected Behavior:

  • The upload button should be disabled (and clearly indicated as such) after a successful file upload.
  • The button should remain disabled until the user selects a new file or indicates readiness for a new upload, preventing duplicate uploads of the same file.
  • The application should provide clear feedback about the upload status, especially when the upload button is disabled, to enhance user experience and avoid confusion.

Benefits:

  • Reduces the risk of unintended duplicate uploads.
  • Improves user experience by providing clear feedback on the upload process and status.
  • Decreases unnecessary network traffic and storage usage.

Considerations:

  • Ensure that the logic for disabling/enabling the upload button is robust, especially in edge cases such as upload failures, user navigation away from the upload page, or browser refreshes.
  • Consider the user flow for uploading multiple files sequentially and ensure the process is intuitive.

This enhancement will contribute to a more efficient and user-friendly file upload process, preventing duplicate uploads and providing clearer communication with users regarding the upload status.

@dahifi dahifi changed the title Error uploading audio when file has already been uploaded Disable Upload Button After Successful Upload to Prevent Duplicate Submissions Feb 1, 2024
@dahifi dahifi added enhancement New feature or request good first issue Good for newcomers labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant