Resurrect Service Worker (#7108)

* Resolve #7106

* fix lint

* fix lint

* save lang in idb

* fix lint

* fix

* cache locale file

* fix lint

* ✌️

* wip

* fix [wip]

* fix [wip]

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
tamaina 2021-02-06 18:55:53 +09:00 committed by GitHub
parent 9b3458fba0
commit 40bfa3ef04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 217 additions and 98 deletions

View file

@ -1,29 +0,0 @@
import getUserName from './get-user-name';
import { getNoteSummary } from './get-note-summary';
import getReactionEmoji from './get-reaction-emoji';
import locales = require('../../locales');
/**
*
* @param notification
*/
export default function(notification: any): string {
switch (notification.type) {
case 'follow':
return `${getUserName(notification.user)}にフォローされました`;
case 'mention':
return `言及されました:\n${getUserName(notification.user)}${getNoteSummary(notification.note, locales['ja-JP'])}`;
case 'reply':
return `返信されました:\n${getUserName(notification.user)}${getNoteSummary(notification.note, locales['ja-JP'])}`;
case 'renote':
return `Renoteされました:\n${getUserName(notification.user)}${getNoteSummary(notification.note, locales['ja-JP'])}`;
case 'quote':
return `引用されました:\n${getUserName(notification.user)}${getNoteSummary(notification.note, locales['ja-JP'])}`;
case 'reaction':
return `リアクションされました:\n${getUserName(notification.user)} <${getReactionEmoji(notification.reaction)}>「${getNoteSummary(notification.note, locales['ja-JP'])}`;
case 'pollVote':
return `投票されました:\n${getUserName(notification.user)}${getNoteSummary(notification.note, locales['ja-JP'])}`;
default:
return `<不明な通知タイプ: ${notification.type}>`;
}
}