Improve entries with missing info

This commit is contained in:
Peter Stuifzand 2018-08-29 20:09:48 +02:00
parent 513368399e
commit 142b6ef28b

View File

@ -37,7 +37,7 @@
<a class="card-footer-item" @click="debug">Debug</a>
<a class="card-footer-item" @click="like">Like</a>
<a class="card-footer-item" @click="repost">Repost</a>
<a class="card-footer-item" @click="reply">Reply</a>
<a class="card-footer-item" @click.prevent="console.log('unimplemented')">Reply</a>
</footer>
</div>
</template>
@ -110,20 +110,28 @@
return 'anonymouse';
}
if (!this.item.author.name) {
if (this.item.author.url) {
return new URL(this.item.author.url).hostname
}
}
return this.item.author.name
},
author_url() {
if (!this.item.author) {
return '';
}
if (!this.item.author.url) {
return '';
}
return this.item.author.url
},
author_photo() {
if (!this.item.author) {
return '';
}
if (!this.item.author.photo) {
return '';
}
return this.item.author.photo
}
}