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

Change state to 'normal' if 'src' is valid #278

Closed
wants to merge 3 commits into from

Conversation

skycrazyk
Copy link

@skycrazyk skycrazyk commented Aug 29, 2023

Possible fix for #277

Explaining

We are not providing onLoad handler if status=error and there is a fallback image. So if src was changed to "valid" There is no way status can be changed to "normal".

Possible decision is to change status to normal when src checked and became valid

@vercel
Copy link

vercel bot commented Aug 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 1, 2023 10:11am

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #278 (d87f5aa) into master (cbf9d8a) will decrease coverage by 0.25%.
The diff coverage is 66.66%.

❗ Current head d87f5aa differs from pull request most recent head 6ce7dc5. Consider uploading reports for the commit 6ce7dc5 to get more accurate results

@@            Coverage Diff             @@
##           master     #278      +/-   ##
==========================================
- Coverage   97.90%   97.65%   -0.25%     
==========================================
  Files          13       13              
  Lines         382      384       +2     
  Branches      108      109       +1     
==========================================
+ Hits          374      375       +1     
- Misses          7        8       +1     
  Partials        1        1              
Files Changed Coverage Δ
src/hooks/useStatus.ts 92.30% <66.66%> (-3.53%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@afc163
Copy link
Member

afc163 commented Aug 29, 2023

Could you add a test case?

@skycrazyk skycrazyk changed the title Always handle onLoad on img Change state to 'normal' if 'src' is valid Aug 31, 2023
@skycrazyk
Copy link
Author

@afc163 I created a simpler reproduce example https://codepen.io/skycrazyk/pen/KKbMZwo, but I cannot catch such error in jest environment

@skycrazyk
Copy link
Author

Fixed here #281

@skycrazyk skycrazyk closed this Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants