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

Prevent infinite load when avatar upload fails #8881

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

nithish1018
Copy link
Contributor

Proposed Changes

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@nithish1018 nithish1018 requested a review from a team as a code owner October 22, 2024 16:09
Copy link

netlify bot commented Oct 22, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 271ee8e
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/6719c6b40b75be000863cb52
😎 Deploy Preview https://deploy-preview-8881--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rithviknishad rithviknishad changed the title Handled failed upload scenario Prevent infinite load when avatar upload fails Oct 23, 2024
@nihal467
Copy link
Member

image
image

When a user attempts to upload a non-permitted image, the system currently throws an error and closes the entire pop-up. This should not be the expected behavior. Instead, the user should remain on the same pop-up, where the error message is displayed, allowing them to re-select and upload an appropriate image.

@nithish1018
Copy link
Contributor Author

image image

When a user attempts to upload a non-permitted image, the system currently throws an error and closes the entire pop-up. This should not be the expected behavior. Instead, the user should remain on the same pop-up, where the error message is displayed, allowing them to re-select and upload an appropriate image.

Made some changes and this is how it works now:

Recording.2024-10-23.144048.mp4

Comment on lines 117 to 128
try {
await handleUpload(selectedFile, () => {
setSelectedFile(undefined);
setPreview(undefined);
setPreviewImage(null);
});
} catch (e) {
console.error(e);
} finally {
setIsCaptureImgBeingUploaded(false);
setIsProcessing(false);
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are not required, just calling onError() in the handler should be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I removed them.
Is it ok now?

@rithviknishad
Copy link
Member

it's still stuck in infinite loading :/

image

Copy link

👋 Hi, @nithish1018,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Oct 23, 2024
@nithish1018
Copy link
Contributor Author

it's still stuck in infinite loading :/

image

I checked it again and it's working fine 🤔

Recording.2024-10-23.162712.mp4

@rithviknishad
Copy link
Member

rithviknishad commented Oct 23, 2024

@nithish1018 can you try updating the profile pic instead of facility cover image?

@nithish1018
Copy link
Contributor Author

@nithish1018 can you try updating the profile pic instead of facility cover image?

Thank you, I added the fix for it

@rithviknishad
Copy link
Member

clear merge conflicts; rest lgtm

@nithish1018 nithish1018 reopened this Oct 24, 2024
@rithviknishad rithviknishad added needs testing and removed changes required merge conflict pull requests with merge conflict labels Oct 24, 2024
@khavinshankar khavinshankar added the reviewed reviewed by a core member label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing reviewed reviewed by a core member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loading issue while updating cover photo of a Facility
5 participants