feat(client): 翻訳をIndexedDBに保存・プッシュ通知を翻訳 (#6396)
* wip * tabun ok * better msg * oops * fix lint * Update gulpfile.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * Update src/client/scripts/set-i18n-contexts.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * refactor Co-authored-by: acid-chicken <root@acid-chicken.com> * ✨ * wip * fix lint * たぶんおk * fix flush * Translate Notification * remove console.log * fix * add notifications * remove san * wip * ok * ✌️ * Update src/prelude/array.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * wip * i18n refactor * Update init.ts * ✌️ Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
parent
11141c878c
commit
3963ed8ff7
143 changed files with 290 additions and 433 deletions
|
@ -2,8 +2,13 @@ import * as push from 'web-push';
|
|||
import config from '../config';
|
||||
import { SwSubscriptions } from '../models';
|
||||
import { fetchMeta } from '../misc/fetch-meta';
|
||||
import { PackedNotification } from '../models/repositories/notification';
|
||||
import { PackedMessagingMessage } from '../models/repositories/messaging-message';
|
||||
|
||||
export default async function(userId: string, type: string, body?: any) {
|
||||
type notificationType = 'notification' | 'unreadMessagingMessage';
|
||||
type notificationBody = PackedNotification | PackedMessagingMessage;
|
||||
|
||||
export default async function(userId: string, type: notificationType, body: notificationBody) {
|
||||
const meta = await fetchMeta();
|
||||
|
||||
if (!meta.enableServiceWorker || meta.swPublicKey == null || meta.swPrivateKey == null) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue