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="debug">Debug</a>
<a class="card-footer-item" @click="like">Like</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="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> </footer>
</div> </div>
</template> </template>
@ -110,7 +110,9 @@
return 'anonymouse'; return 'anonymouse';
} }
if (!this.item.author.name) { if (!this.item.author.name) {
return new URL(this.item.author.url).hostname if (this.item.author.url) {
return new URL(this.item.author.url).hostname
}
} }
return this.item.author.name return this.item.author.name
}, },
@ -118,12 +120,18 @@
if (!this.item.author) { if (!this.item.author) {
return ''; return '';
} }
if (!this.item.author.url) {
return '';
}
return this.item.author.url return this.item.author.url
}, },
author_photo() { author_photo() {
if (!this.item.author) { if (!this.item.author) {
return ''; return '';
} }
if (!this.item.author.photo) {
return '';
}
return this.item.author.photo return this.item.author.photo
} }
} }