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

@@ -10,7 +10,7 @@
</router-link>
%fa:retweet%
<span>{{ '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.substr(0, '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.indexOf('{')) }}</span>
<a class="name" :href="`/@${acct}`" v-user-preview="post.userId">{{ post.user.name }}</a>
<a class="name" :href="`/@${acct}`" v-user-preview="post.userId">{{ getUserName(post.user) }}</a>
<span>{{ '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.substr('%i18n:desktop.tags.mk-timeline-post.reposted-by%'.indexOf('}') + 1) }}</span>
</p>
<mk-time :time="post.createdAt"/>
@@ -86,6 +86,7 @@
import Vue from 'vue';
import dateStringify from '../../../common/scripts/date-stringify';
import getAcct from '../../../../../acct/render';
import getUserName from '../../../../../renderers/get-user-name';
import parse from '../../../../../text/parse';
import MkPostFormWindow from './post-form-window.vue';
@@ -124,6 +125,9 @@ export default Vue.extend({
acct(): string {
return getAcct(this.p.user);
},
name(): string {
return getUserName(this.p.user);
},
isRepost(): boolean {
return (this.post.repost &&
this.post.text == null &&