リアクションもServiceWorkerで通知するように

This commit is contained in:
syuilo
2017-11-23 06:03:54 +09:00
parent 78609f5edd
commit 182612d540
2 changed files with 17 additions and 1 deletions

View File

@ -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}さんからメッセージ:`,