Skip to content

Commit

Permalink
fix issue with default avatar if country code is XX
Browse files Browse the repository at this point in the history
  • Loading branch information
bandinopla committed Mar 15, 2024
1 parent d447271 commit 4ee9e64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/componentes/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import "./flags.css";

export default function({ cc }) {

return <i className={"flag flag-"+ (cc?.toLowerCase()||"xx")} style={{ backgroundImage:"url("+flags_img_src+")" }}>{cc?"":"?"}</i>
return <i className={"flag flag-"+ (cc?.toLowerCase()||"xx")} style={{ backgroundImage:"url("+flags_img_src+")" }}>{cc && cc.toLowerCase()!="xx"?"":"?"}</i>
}
2 changes: 1 addition & 1 deletion src/componentes/uavatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const uid2avatarurl = (id,hash)=>{

export default function UAvatar({ uid, hash, slvl = 0, sactive=false, height, width, iconsScale=1, variant, className, cc })
{
const src = (!hash || hash=="") && cc?"https://flagcdn.com/w160/"+cc.toLowerCase()+".png" : uid2avatarurl(uid, hash);
const src = (!hash || hash=="") && cc && cc.toLowerCase()!="xx"?"https://flagcdn.com/w160/"+cc.toLowerCase()+".png" : uid2avatarurl(uid, hash);
const img = `url( ${ src } )`;

if( variant=="circular")
Expand Down

0 comments on commit 4ee9e64

Please sign in to comment.