summaryrefslogtreecommitdiff
path: root/src/client/app/mobile/views/components
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-04-06 01:36:34 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-04-06 01:36:34 +0900
commitf0e8e6392b5ef99488ea0bbecbf9029e30ef0cfa (patch)
tree736d3fe581b6b9169d8e676453019e1d2afec876 /src/client/app/mobile/views/components
parentMerge pull request #1403 from akihikodaki/duplicate (diff)
downloadsharkey-f0e8e6392b5ef99488ea0bbecbf9029e30ef0cfa.tar.gz
sharkey-f0e8e6392b5ef99488ea0bbecbf9029e30ef0cfa.tar.bz2
sharkey-f0e8e6392b5ef99488ea0bbecbf9029e30ef0cfa.zip
Allow name property of user to be null
Diffstat (limited to 'src/client/app/mobile/views/components')
-rw-r--r--src/client/app/mobile/views/components/notification-preview.vue23
-rw-r--r--src/client/app/mobile/views/components/notification.vue15
-rw-r--r--src/client/app/mobile/views/components/post-card.vue6
-rw-r--r--src/client/app/mobile/views/components/post-detail.sub.vue6
-rw-r--r--src/client/app/mobile/views/components/post-detail.vue11
-rw-r--r--src/client/app/mobile/views/components/post-preview.vue6
-rw-r--r--src/client/app/mobile/views/components/post.sub.vue6
-rw-r--r--src/client/app/mobile/views/components/post.vue11
-rw-r--r--src/client/app/mobile/views/components/ui.header.vue8
-rw-r--r--src/client/app/mobile/views/components/ui.nav.vue8
-rw-r--r--src/client/app/mobile/views/components/user-card.vue6
-rw-r--r--src/client/app/mobile/views/components/user-preview.vue6
12 files changed, 89 insertions, 23 deletions
diff --git a/src/client/app/mobile/views/components/notification-preview.vue b/src/client/app/mobile/views/components/notification-preview.vue
index 77abd3c0ea..0492c5d86c 100644
--- a/src/client/app/mobile/views/components/notification-preview.vue
+++ b/src/client/app/mobile/views/components/notification-preview.vue
@@ -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
diff --git a/src/client/app/mobile/views/components/notification.vue b/src/client/app/mobile/views/components/notification.vue
index 189d7195fb..62a0e6425e 100644
--- a/src/client/app/mobile/views/components/notification.vue
+++ b/src/client/app/mobile/views/components/notification.vue
@@ -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() {
diff --git a/src/client/app/mobile/views/components/post-card.vue b/src/client/app/mobile/views/components/post-card.vue
index 38d4522d26..68a42ef249 100644
--- a/src/client/app/mobile/views/components/post-card.vue
+++ b/src/client/app/mobile/views/components/post-card.vue
@@ -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);
}
diff --git a/src/client/app/mobile/views/components/post-detail.sub.vue b/src/client/app/mobile/views/components/post-detail.sub.vue
index 7ff9f1aabd..98d6a14cac 100644
--- a/src/client/app/mobile/views/components/post-detail.sub.vue
+++ b/src/client/app/mobile/views/components/post-detail.sub.vue
@@ -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);
}
}
});
diff --git a/src/client/app/mobile/views/components/post-detail.vue b/src/client/app/mobile/views/components/post-detail.vue
index ed394acd36..0226ce081a 100644
--- a/src/client/app/mobile/views/components/post-detail.vue
+++ b/src/client/app/mobile/views/components/post-detail.vue
@@ -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 &&
diff --git a/src/client/app/mobile/views/components/post-preview.vue b/src/client/app/mobile/views/components/post-preview.vue
index 81b0c22bfb..96bd4d5c15 100644
--- a/src/client/app/mobile/views/components/post-preview.vue
+++ b/src/client/app/mobile/views/components/post-preview.vue
@@ -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);
}
}
});
diff --git a/src/client/app/mobile/views/components/post.sub.vue b/src/client/app/mobile/views/components/post.sub.vue
index 85ddb91880..909d5cb597 100644
--- a/src/client/app/mobile/views/components/post.sub.vue
+++ b/src/client/app/mobile/views/components/post.sub.vue
@@ -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);
}
}
});
diff --git a/src/client/app/mobile/views/components/post.vue b/src/client/app/mobile/views/components/post.vue
index 1454bc939f..eee1e80fd3 100644
--- a/src/client/app/mobile/views/components/post.vue
+++ b/src/client/app/mobile/views/components/post.vue
@@ -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 &&
diff --git a/src/client/app/mobile/views/components/ui.header.vue b/src/client/app/mobile/views/components/ui.header.vue
index 2bf47a90a9..fd4f31fd98 100644
--- a/src/client/app/mobile/views/components/ui.header.vue
+++ b/src/client/app/mobile/views/components/ui.header.vue
@@ -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,
diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue
index a923774a73..61dd8ca9de 100644
--- a/src/client/app/mobile/views/components/ui.nav.vue
+++ b/src/client/app/mobile/views/components/ui.nav.vue
@@ -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,
diff --git a/src/client/app/mobile/views/components/user-card.vue b/src/client/app/mobile/views/components/user-card.vue
index 46fa3b4732..e8698a62f0 100644
--- a/src/client/app/mobile/views/components/user-card.vue
+++ b/src/client/app/mobile/views/components/user-card.vue
@@ -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);
}
}
});
diff --git a/src/client/app/mobile/views/components/user-preview.vue b/src/client/app/mobile/views/components/user-preview.vue
index 00f87e5549..72a6bcf8ad 100644
--- a/src/client/app/mobile/views/components/user-preview.vue
+++ b/src/client/app/mobile/views/components/user-preview.vue
@@ -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);
}
}
});