From 182612d5401f2b91b6bda1bb85fda44605ef51d1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 23 Nov 2017 06:03:54 +0900 Subject: リアクションもServiceWorkerで通知するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/app/common/scripts/compose-notification.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/web/app/common/scripts') diff --git a/src/web/app/common/scripts/compose-notification.ts b/src/web/app/common/scripts/compose-notification.ts index 181dca734f..d0e0c2098d 100644 --- a/src/web/app/common/scripts/compose-notification.ts +++ b/src/web/app/common/scripts/compose-notification.ts @@ -1,4 +1,5 @@ import getPostSummary from '../../../../common/get-post-summary'; +import getReactionEmoji from '../../../../common/get-reaction-emoji'; type Notification = { title: string; @@ -39,6 +40,13 @@ export default function(type, data): Notification { icon: data.user.avatar_url + '?thumbnail&size=64' }; + case 'reaction': + return { + title: `${data.user.name}: ${getReactionEmoji(data.reaction)}:`, + body: getPostSummary(data.post), + icon: data.user.avatar_url + '?thumbnail&size=64' + }; + case 'unread_messaging_message': return { title: `${data.user.name}さんからメッセージ:`, -- cgit v1.2.3-freya