mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
Merge pull request #5801 from nextcloud/bugfix/noid/fallback-to-other-data
Correctly fallback in case of missing data
This commit is contained in:
commit
e07ccffea0
1 changed files with 18 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
@ -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')
|
||||
},
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue