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:
parent
9b3458fba0
commit
40bfa3ef04
12 changed files with 217 additions and 98 deletions
|
|
@ -1,8 +1,17 @@
|
|||
/**
|
||||
* Notification composer of Service Worker
|
||||
*/
|
||||
declare var self: ServiceWorkerGlobalScope;
|
||||
|
||||
import { getNoteSummary } from '../../misc/get-note-summary';
|
||||
import getUserName from '../../misc/get-user-name';
|
||||
import { i18n } from '@/sw/i18n';
|
||||
|
||||
export default async function(type, data): Promise<[string, NotificationOptions]> {
|
||||
export default async function(type, data, i18n): Promise<[string, NotificationOptions] | null | undefined> {
|
||||
if (!i18n) {
|
||||
console.log('no i18n');
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'driveFileCreated': // TODO (Server Side)
|
||||
return [i18n.t('_notification.fileUploaded'), {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue