mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
omg fix this infinite loop if image keeps erroring
This commit is contained in:
parent
a3015e75f0
commit
0467dc7c09
1 changed files with 4 additions and 2 deletions
|
@ -36,8 +36,10 @@ function Avatar({ url, size, alt = '', ...props }) {
|
|||
loading="lazy"
|
||||
crossOrigin={alphaCache[url] === undefined ? 'anonymous' : undefined}
|
||||
onError={(e) => {
|
||||
e.target.crossOrigin = null;
|
||||
e.target.src = url;
|
||||
if (e.target.crossOrigin) {
|
||||
e.target.crossOrigin = null;
|
||||
e.target.src = url;
|
||||
}
|
||||
}}
|
||||
onLoad={(e) => {
|
||||
if (avatarRef.current) avatarRef.current.dataset.loaded = true;
|
||||
|
|
Loading…
Reference in a new issue