Skip to content

Commit

Permalink
Merge pull request #5801 from nextcloud/bugfix/noid/fallback-to-other…
Browse files Browse the repository at this point in the history
…-data

Correctly fallback in case of missing data
  • Loading branch information
nickvergessen authored Jun 18, 2021
2 parents 3c9e0e1 + 300f482 commit e07ccff
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
:aria-label="contactAriaLabel"
target="_blank">
<img v-if="contactPhotoFromBase64"
class="contact__image"
:class="{
'contact__image': contactHasPhoto,
'contact__icon': !contactHasPhoto,
}"
alt=""
:src="contactPhotoFromBase64">
<div class="contact__lineone">
<div class="title">
{{ contactName }}
{{ displayName }}
</div>
</div>
</a>
Expand Down Expand Up @@ -75,12 +78,18 @@ export default {
},
computed: {
contactHasPhoto() {
return this.contactPhotoMimetype && this.contactPhoto
},
contactPhotoFromBase64() {
if (!this.contactPhotoMimetype || !this.contactPhoto) {
return null
if (!this.contactHasPhoto) {
return OC.MimeType.getIconUrl('text/vcard')
}
return 'data:' + this.contactPhotoMimetype + ';base64,' + this.contactPhoto
},
displayName() {
return this.contactName || this.name
},
contactAriaLabel() {
return t('spreed', 'Contact')
},
Expand Down Expand Up @@ -111,6 +120,11 @@ export default {
max-width: 44px;
max-height: 44px;
}
&__icon {
display: inline-block;
width: 44px;
height: 44px;
}
&__lineone {
height: 30px;
display: flex;
Expand Down

0 comments on commit e07ccff

Please sign in to comment.