summaryrefslogtreecommitdiff
path: root/src/client/sw/compose-notification.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/sw/compose-notification.ts')
-rw-r--r--src/client/sw/compose-notification.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/sw/compose-notification.ts b/src/client/sw/compose-notification.ts
index 17421db5c8..e9586dd574 100644
--- a/src/client/sw/compose-notification.ts
+++ b/src/client/sw/compose-notification.ts
@@ -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'), {