Allow name property of user to be null

This commit is contained in:
Akihiko Odaki 2018-04-06 01:36:34 +09:00
parent 46e8fd44c1
commit f0e8e6392b
52 changed files with 311 additions and 107 deletions

View file

@ -5,7 +5,7 @@
</router-link>
<div class="main">
<header>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.userId">{{ post.user.name }}</router-link>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.userId">{{ name }}</router-link>
<span class="username">@{{ acct }}</span>
<router-link class="time" :to="`/@${acct}/${post.id}`">
<mk-time :time="post.createdAt"/>
@ -22,6 +22,7 @@
import Vue from 'vue';
import dateStringify from '../../../common/scripts/date-stringify';
import getAcct from '../../../../../acct/render';
import getUserName from '../../../../../renderers/get-user-name';
export default Vue.extend({
props: ['post'],
@ -29,6 +30,9 @@ export default Vue.extend({
acct() {
return getAcct(this.post.user);
},
name() {
return getUserName(this.post.user);
},
title(): string {
return dateStringify(this.post.createdAt);
}