fix: show placeholder on not loaded avatar to void showing alt text (#1054)

This commit is contained in:
Michel EDIGHOFFER 2023-01-13 10:23:51 +01:00 committed by GitHub
parent 3367ba6e30
commit 5c9a21eb9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ const error = $ref(false)
:key="account.avatar"
width="400"
height="400"
:src="error ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : account.avatar"
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : account.avatar"
:alt="$t('account.avatar_description', [account.username])"
loading="lazy"
:class="(loaded ? 'bg-base' : 'bg-gray:10') + (square ? ' ' : ' rounded-full')"