Update compose-notification.ts

This commit is contained in:
syuilo 2019-02-28 20:57:38 +09:00
parent b6dc6c6984
commit 9a9fb37a78
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
1 changed files with 7 additions and 7 deletions

View File

@ -15,22 +15,22 @@ export default function(type, data): Notification {
switch (type) { switch (type) {
case 'driveFileCreated': case 'driveFileCreated':
return { return {
title: '%i18n:common.notification.file-uploaded%', title: 'File uploaded',
body: data.name, body: data.name,
icon: data.url icon: data.url
}; };
case 'unreadMessagingMessage': case 'unreadMessagingMessage':
return { return {
title: '%i18n:common.notification.message-from%'.split('{}')[0] + `${getUserName(data.user)}` + '%i18n:common.notification.message-from%'.split('{}')[1] , title: `New message from ${getUserName(data.user)}`,
body: data.text, // TODO: getMessagingMessageSummary(data), body: data.text, // TODO: getMessagingMessageSummary(data),
icon: data.user.avatarUrl icon: data.user.avatarUrl
}; };
case 'reversiInvited': case 'reversiInvited':
return { return {
title: '%i18n:common.notification.reversi-invited%', title: 'Play reversi with me',
body: '%i18n:common.notification.reversi-invited-by%'.split('{}')[0] + `${getUserName(data.parent)}` + '%i18n:common.notification.reversi-invited-by%'.split('{}')[1], body: `You got reversi invitation from ${getUserName(data.parent)}`,
icon: data.parent.avatarUrl icon: data.parent.avatarUrl
}; };
@ -38,21 +38,21 @@ export default function(type, data): Notification {
switch (data.type) { switch (data.type) {
case 'mention': case 'mention':
return { return {
title: '%i18n:common.notification.notified-by%'.split('{}')[0] + `${getUserName(data.user)}:` + '%i18n:common.notification.notified-by%'.split('{}')[1], title: `${getUserName(data.user)}:`,
body: getNoteSummary(data), body: getNoteSummary(data),
icon: data.user.avatarUrl icon: data.user.avatarUrl
}; };
case 'reply': case 'reply':
return { return {
title: '%i18n:common.notification.reply-from%'.split('{}')[0] + `${getUserName(data.user)}` + '%i18n:common.notification.reply-from%'.split('{}')[1], title: `You got reply from ${getUserName(data.user)}:`,
body: getNoteSummary(data), body: getNoteSummary(data),
icon: data.user.avatarUrl icon: data.user.avatarUrl
}; };
case 'quote': case 'quote':
return { return {
title: '%i18n:common.notification.quoted-by%'.split('{}')[0] + `${getUserName(data.user)}` + '%i18n:common.notification.quoted-by%'.split('{}')[1], title: `${getUserName(data.user)}:`,
body: getNoteSummary(data), body: getNoteSummary(data),
icon: data.user.avatarUrl icon: data.user.avatarUrl
}; };