Allow name property of user to be null
This commit is contained in:
parent
46e8fd44c1
commit
f0e8e6392b
52 changed files with 311 additions and 107 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<template v-if="notification.type == 'reaction'">
|
||||
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p><mk-reaction-icon :reaction="notification.reaction"/>{{ notification.user.name }}</p>
|
||||
<p><mk-reaction-icon :reaction="notification.reaction"/>{{ name }}</p>
|
||||
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%</p>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<template v-if="notification.type == 'repost'">
|
||||
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p>%fa:retweet%{{ notification.post.user.name }}</p>
|
||||
<p>%fa:retweet%{{ posterName }}</p>
|
||||
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%</p>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
<template v-if="notification.type == 'quote'">
|
||||
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p>%fa:quote-left%{{ notification.post.user.name }}</p>
|
||||
<p>%fa:quote-left%{{ posterName }}</p>
|
||||
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -27,14 +27,14 @@
|
|||
<template v-if="notification.type == 'follow'">
|
||||
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p>%fa:user-plus%{{ notification.user.name }}</p>
|
||||
<p>%fa:user-plus%{{ name }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="notification.type == 'reply'">
|
||||
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p>%fa:reply%{{ notification.post.user.name }}</p>
|
||||
<p>%fa:reply%{{ posterName }}</p>
|
||||
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
<template v-if="notification.type == 'mention'">
|
||||
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p>%fa:at%{{ notification.post.user.name }}</p>
|
||||
<p>%fa:at%{{ posterName }}</p>
|
||||
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
<template v-if="notification.type == 'poll_vote'">
|
||||
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
<div class="text">
|
||||
<p>%fa:chart-pie%{{ notification.user.name }}</p>
|
||||
<p>%fa:chart-pie%{{ name }}</p>
|
||||
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%</p>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -60,9 +60,18 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getPostSummary from '../../../../../renderers/get-post-summary';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['notification'],
|
||||
computed: {
|
||||
name() {
|
||||
return getUserName(this.notification.user);
|
||||
},
|
||||
posterName() {
|
||||
return getUserName(this.notification.post.user);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
getPostSummary
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<div class="text">
|
||||
<p>
|
||||
<mk-reaction-icon :reaction="notification.reaction"/>
|
||||
<router-link :to="`/@${acct}`">{{ notification.user.name }}</router-link>
|
||||
<router-link :to="`/@${acct}`">{{ getUserName(notification.user) }}</router-link>
|
||||
</p>
|
||||
<router-link class="post-ref" :to="`/@${acct}/${notification.post.id}`">
|
||||
%fa:quote-left%{{ getPostSummary(notification.post) }}
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="text">
|
||||
<p>
|
||||
%fa:retweet%
|
||||
<router-link :to="`/@${acct}`">{{ notification.post.user.name }}</router-link>
|
||||
<router-link :to="`/@${acct}`">{{ getUserName(notification.post.user) }}</router-link>
|
||||
</p>
|
||||
<router-link class="post-ref" :to="`/@${acct}/${notification.post.id}`">
|
||||
%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
<div class="text">
|
||||
<p>
|
||||
%fa:user-plus%
|
||||
<router-link :to="`/@${acct}`">{{ notification.user.name }}</router-link>
|
||||
<router-link :to="`/@${acct}`">{{ getUserName(notification.user) }}</router-link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
<div class="text">
|
||||
<p>
|
||||
%fa:chart-pie%
|
||||
<router-link :to="`/@${acct}`">{{ notification.user.name }}</router-link>
|
||||
<router-link :to="`/@${acct}`">{{ getUserName(notification.user) }}</router-link>
|
||||
</p>
|
||||
<router-link class="post-ref" :to="`/@${acct}/${notification.post.id}`">
|
||||
%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%
|
||||
|
|
@ -80,12 +80,19 @@
|
|||
import Vue from 'vue';
|
||||
import getPostSummary from '../../../../../renderers/get-post-summary';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['notification'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.notification.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.notification.user);
|
||||
},
|
||||
posterName() {
|
||||
return getUserName(this.notification.post.user);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="mk-post-card">
|
||||
<a :href="`/@${acct}/${post.id}`">
|
||||
<header>
|
||||
<img :src="`${acct}?thumbnail&size=64`" alt="avatar"/><h3>{{ post.user.name }}</h3>
|
||||
<img :src="`${acct}?thumbnail&size=64`" alt="avatar"/><h3>{{ name }}</h3>
|
||||
</header>
|
||||
<div>
|
||||
{{ text }}
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
import Vue from 'vue';
|
||||
import summary from '../../../../../renderers/get-post-summary';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
|
|
@ -23,6 +24,9 @@ export default Vue.extend({
|
|||
acct() {
|
||||
return getAcct(this.post.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.post.user);
|
||||
},
|
||||
text(): string {
|
||||
return summary(this.post);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</router-link>
|
||||
<div class="main">
|
||||
<header>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ post.user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ getUserName(post.user) }}</router-link>
|
||||
<span class="username">@{{ acct }}</span>
|
||||
<router-link class="time" :to="`/@${acct}/${post.id}`">
|
||||
<mk-time :time="post.createdAt"/>
|
||||
|
|
@ -21,12 +21,16 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.post.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.post.user);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
</router-link>
|
||||
%fa:retweet%
|
||||
<router-link class="name" :to="`/@${acct}`">
|
||||
{{ post.user.name }}
|
||||
{{ name }}
|
||||
</router-link>
|
||||
がRepost
|
||||
</p>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||
</router-link>
|
||||
<div>
|
||||
<router-link class="name" :to="`/@${pAcct}`">{{ p.user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${pAcct}`">{{ pName }}</router-link>
|
||||
<span class="username">@{{ pAcct }}</span>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -81,6 +81,7 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
import parse from '../../../../../text/parse';
|
||||
|
||||
import MkPostMenu from '../../../common/views/components/post-menu.vue';
|
||||
|
|
@ -114,9 +115,15 @@ export default Vue.extend({
|
|||
acct(): string {
|
||||
return getAcct(this.post.user);
|
||||
},
|
||||
name(): string {
|
||||
return getUserName(this.post.user);
|
||||
},
|
||||
pAcct(): string {
|
||||
return getAcct(this.p.user);
|
||||
},
|
||||
pName(): string {
|
||||
return getUserName(this.p.user);
|
||||
},
|
||||
isRepost(): boolean {
|
||||
return (this.post.repost &&
|
||||
this.post.text == null &&
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</router-link>
|
||||
<div class="main">
|
||||
<header>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ post.user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ name }}</router-link>
|
||||
<span class="username">@{{ acct }}</span>
|
||||
<router-link class="time" :to="`/@${acct}/${post.id}`">
|
||||
<mk-time :time="post.createdAt"/>
|
||||
|
|
@ -21,12 +21,16 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.post.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.post.user);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</router-link>
|
||||
<div class="main">
|
||||
<header>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ post.user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ getUserName(post.user) }}</router-link>
|
||||
<span class="username">@{{ acct }}</span>
|
||||
<router-link class="created-at" :to="`/@${acct}/${post.id}`">
|
||||
<mk-time :time="post.createdAt"/>
|
||||
|
|
@ -21,12 +21,16 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.post.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.post.user);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</router-link>
|
||||
%fa:retweet%
|
||||
<span>{{ '%i18n:mobile.tags.mk-timeline-post.reposted-by%'.substr(0, '%i18n:mobile.tags.mk-timeline-post.reposted-by%'.indexOf('{')) }}</span>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ post.user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ name }}</router-link>
|
||||
<span>{{ '%i18n:mobile.tags.mk-timeline-post.reposted-by%'.substr('%i18n:mobile.tags.mk-timeline-post.reposted-by%'.indexOf('}') + 1) }}</span>
|
||||
</p>
|
||||
<mk-time :time="post.createdAt"/>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
</router-link>
|
||||
<div class="main">
|
||||
<header>
|
||||
<router-link class="name" :to="`/@${pAcct}`">{{ p.user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${pAcct}`">{{ pName }}</router-link>
|
||||
<span class="is-bot" v-if="p.user.host === null && p.user.account.isBot">bot</span>
|
||||
<span class="username">@{{ pAcct }}</span>
|
||||
<div class="info">
|
||||
|
|
@ -78,6 +78,7 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
import parse from '../../../../../text/parse';
|
||||
|
||||
import MkPostMenu from '../../../common/views/components/post-menu.vue';
|
||||
|
|
@ -102,9 +103,15 @@ export default Vue.extend({
|
|||
acct(): string {
|
||||
return getAcct(this.post.user);
|
||||
},
|
||||
name(): string {
|
||||
return getUserName(this.post.user);
|
||||
},
|
||||
pAcct(): string {
|
||||
return getAcct(this.p.user);
|
||||
},
|
||||
pName(): string {
|
||||
return getUserName(this.p.user);
|
||||
},
|
||||
isRepost(): boolean {
|
||||
return (this.post.repost &&
|
||||
this.post.text == null &&
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<mk-special-message/>
|
||||
<div class="main" ref="main">
|
||||
<div class="backdrop"></div>
|
||||
<p ref="welcomeback" v-if="os.isSignedIn">おかえりなさい、<b>{{ os.i.name }}</b>さん</p>
|
||||
<p ref="welcomeback" v-if="os.isSignedIn">おかえりなさい、<b>{{ name }}</b>さん</p>
|
||||
<div class="content" ref="mainContainer">
|
||||
<button class="nav" @click="$parent.isDrawerOpening = true">%fa:bars%</button>
|
||||
<template v-if="hasUnreadNotifications || hasUnreadMessagingMessages || hasGameInvitations">%fa:circle%</template>
|
||||
|
|
@ -19,9 +19,15 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import * as anime from 'animejs';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['func'],
|
||||
computed: {
|
||||
name() {
|
||||
return getUserName(this.os.i);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hasUnreadNotifications: false,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="body" v-if="isOpen">
|
||||
<router-link class="me" v-if="os.isSignedIn" :to="`/@${os.i.username}`">
|
||||
<img class="avatar" :src="`${os.i.avatarUrl}?thumbnail&size=128`" alt="avatar"/>
|
||||
<p class="name">{{ os.i.name }}</p>
|
||||
<p class="name">{{ name }}</p>
|
||||
</router-link>
|
||||
<div class="links">
|
||||
<ul>
|
||||
|
|
@ -40,9 +40,15 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { docsUrl, chUrl, lang } from '../../../config';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['isOpen'],
|
||||
computed: {
|
||||
name() {
|
||||
return getUserName(this.os.i);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hasUnreadNotifications: false,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<img :src="`${user.avatarUrl}?thumbnail&size=200`" alt="avatar"/>
|
||||
</a>
|
||||
</header>
|
||||
<a class="name" :href="`/@${acct}`" target="_blank">{{ user.name }}</a>
|
||||
<a class="name" :href="`/@${acct}`" target="_blank">{{ name }}</a>
|
||||
<p class="username">@{{ acct }}</p>
|
||||
<mk-follow-button :user="user"/>
|
||||
</div>
|
||||
|
|
@ -14,12 +14,16 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['user'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.user);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</router-link>
|
||||
<div class="main">
|
||||
<header>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ user.name }}</router-link>
|
||||
<router-link class="name" :to="`/@${acct}`">{{ name }}</router-link>
|
||||
<span class="username">@{{ acct }}</span>
|
||||
</header>
|
||||
<div class="body">
|
||||
|
|
@ -18,12 +18,16 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['user'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.user);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue