Make sure the image become hidden again if the src becomes falsy

This commit is contained in:
2025-08-01 23:43:59 +02:00
parent fc1f20f50c
commit 83a6251f4c
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@tp/tp-avatar",
"version": "1.0.4",
"version": "1.0.5",
"description": "",
"main": "tp-avatar.js",
"scripts": {

View File

@@ -62,7 +62,7 @@ class TpAvatar extends DomQuery(LitElement) {
const { loaded, hasSrc } = this;
return html`
<div id="avatarImg" part="avatarImg" class=${classMap({ visible: loaded, hidden: !loaded })}></div>
<div id="avatarImg" part="avatarImg" class=${classMap({ visible: loaded && hasSrc, hidden: !loaded || !hasSrc })}></div>
<tp-icon id="placeHolder" part="placeholder" .icon=${TpAvatar.defaultAccountIcon} class=${classMap({ visible: !loaded || !hasSrc, hidden: loaded && hasSrc})}></tp-icon>
`;
}