fix: display already-loaded imgs with no transition (#6990)
This commit is contained in:
parent
db0cb41b61
commit
4537a4dc94
@ -76,7 +76,11 @@ export default function AssetLogo({
|
|||||||
}: AssetLogoProps) {
|
}: AssetLogoProps) {
|
||||||
const [src, nextSrc] = useTokenLogoSource(address, chainId, isNative, backupImg)
|
const [src, nextSrc] = useTokenLogoSource(address, chainId, isNative, backupImg)
|
||||||
const L2Icon = getChainInfo(chainId)?.circleLogoUrl
|
const L2Icon = getChainInfo(chainId)?.circleLogoUrl
|
||||||
const [imgLoaded, setImgLoaded] = useState(false)
|
const [imgLoaded, setImgLoaded] = useState(() => {
|
||||||
|
const img = document.createElement('img')
|
||||||
|
img.src = src ?? ''
|
||||||
|
return src ? img.complete : false
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LogoContainer style={style}>
|
<LogoContainer style={style}>
|
||||||
|
Loading…
Reference in New Issue
Block a user