-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix: handle image load error #35915
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
base: main
Are you sure you want to change the base?
fix: handle image load error #35915
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨🎨 @MetaMask/design-system-engineers (1 files, +37 -16)
|
@@ -43,20 +77,7 @@ export const AvatarFavicon: AvatarFaviconComponent = React.forwardRef( | |||
className={classnames('mm-avatar-favicon', className)} | |||
{...{ borderColor, ...(props as AvatarBaseProps<C>) }} | |||
> | |||
{src ? ( |
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.
- Extracted out
import { PolymorphicRef } from '../box'; | ||
import { | ||
AvatarFaviconComponent, | ||
AvatarFaviconProps, | ||
AvatarFaviconSize, | ||
} from './avatar-favicon.types'; | ||
|
||
const Favicon = (props: { src?: string; name: string }) => { |
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.
- Extracted into here + added image error handling to fallback to getAvatarFallbackLetter
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [1701cfe]
UI Startup Metrics (1236 ± 73 ms)
Benchmark value 1074 exceeds gate value 1070 for chrome browserify home mean load Benchmark value 1067 exceeds gate value 1061 for chrome browserify home mean domContentLoaded Benchmark value 251 exceeds gate value 10 for chrome browserify home mean backgroundConnect Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 1381 exceeds gate value 1365 for chrome browserify home p95 uiStartup Benchmark value 1214 exceeds gate value 1190 for chrome browserify home p95 load Benchmark value 1205 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded Benchmark value 42 exceeds gate value 41 for chrome browserify home p95 domInteractive Benchmark value 261 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 13 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 955 exceeds gate value 940 for chrome browserify home p95 loadScripts Benchmark value 278 exceeds gate value 195 for chrome webpack home p95 getState Benchmark value 17 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 35 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 28 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 4 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 202 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 10 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 1664 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1422 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1422 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 112 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 32 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 48 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 6 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 1399 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 1663 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1663 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 309 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 56 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 8 exceeds gate value 2 for firefox webpack home p95 initialActions Benchmark value 1642 exceeds gate value 1630 for firefox webpack home p95 loadScripts Sum of mean exceeds: 482ms | Sum of p95 exceeds: 626.8ms Sum of all benchmark exceeds: 1108.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Handle image load error on a dApp site's favicon
Changelog
CHANGELOG entry: null
Related issues
Fixes: #35909
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist