Fix/upload button visibility on failure#300
Open
stephenOwino wants to merge 2 commits intoDevinoSolutions:masterfrom
Open
Fix/upload button visibility on failure#300stephenOwino wants to merge 2 commits intoDevinoSolutions:masterfrom
stephenOwino wants to merge 2 commits intoDevinoSolutions:masterfrom
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
THE PROBLEM
The upload button remains visible (though disabled) after upload failures. This creates a confusing user experience where a non-functional button stays on screen.
THE ROOT CAUSE
In
FileList.tsxa, the ShouldRender condition only checks if upload is not successful<ShouldRender if={uploadStatus !== UploadStatus.SUCCESSFUL}>
MY SOLUTION
Updated the condition to hide the button for both SUCCESSFUL and FAILED states:
<ShouldRender if={uploadStatus !== UploadStatus.SUCCESSFUL && uploadStatus !== UploadStatus.FAILED}>
The upload button now:
TESTING
The bug was discovered while testing locally without S3 configuration. When uploads fail with missing environment variables, the backend returns a 500 error and uploadStatus becomes FAILED. The button previously remained visible in this state.
FILE CHANGED
packages/upup/src/components/FileList.tsx