summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/compose-notification.ts
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/common/scripts/compose-notification.ts
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/common/scripts/compose-notification.ts')
-rw-r--r--src/client/app/common/scripts/compose-notification.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts
index ebc15952f6..e99d502960 100644
--- a/src/client/app/common/scripts/compose-notification.ts
+++ b/src/client/app/common/scripts/compose-notification.ts
@@ -1,5 +1,6 @@
import getPostSummary from '../../../../renderers/get-post-summary';
import getReactionEmoji from '../../../../renderers/get-reaction-emoji';
+import getUserName from '../../../../renderers/get-user-name';
type Notification = {
title: string;
@@ -21,35 +22,35 @@ export default function(type, data): Notification {
case 'mention':
return {
- title: `${data.user.name}さんから:`,
+ title: `${getUserName(data.user)}さんから:`,
body: getPostSummary(data),
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'reply':
return {
- title: `${data.user.name}さんから返信:`,
+ title: `${getUserName(data.user)}さんから返信:`,
body: getPostSummary(data),
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'quote':
return {
- title: `${data.user.name}さんが引用:`,
+ title: `${getUserName(data.user)}さんが引用:`,
body: getPostSummary(data),
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'reaction':
return {
- title: `${data.user.name}: ${getReactionEmoji(data.reaction)}:`,
+ title: `${getUserName(data.user)}: ${getReactionEmoji(data.reaction)}:`,
body: getPostSummary(data.post),
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'unread_messaging_message':
return {
- title: `${data.user.name}さんからメッセージ:`,
+ title: `${getUserName(data.user)}さんからメッセージ:`,
body: data.text, // TODO: getMessagingMessageSummary(data),
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
@@ -57,7 +58,7 @@ export default function(type, data): Notification {
case 'othello_invited':
return {
title: '対局への招待があります',
- body: `${data.parent.name}さんから`,
+ body: `${getUserName(data.parent)}さんから`,
icon: data.parent.avatarUrl + '?thumbnail&size=64'
};