diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index 01b9ab588..03ce2a60d 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -1,7 +1,7 @@ /* * Notification manager for SW */ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { swLang } from "@/scripts/lang"; import { cli } from "@/scripts/operations"; @@ -45,7 +45,7 @@ async function composeNotification( */ case "notification": switch (data.body.type) { - case "follow": + case "follow": { // users/showの型定義をswos.apiへ当てはめるのが困難なのでapiFetch.requestを直接使用 const account = await getAccountFromId(data.userId); if (!account) return null; @@ -71,6 +71,7 @@ async function composeNotification( ], }, ]; + } case "mention": return [ @@ -157,7 +158,7 @@ async function composeNotification( }, ]; - case "reaction": + case "reaction": { let reaction = data.body.reaction; let badge: string | undefined; @@ -214,6 +215,7 @@ async function composeNotification( ], }, ]; + } case "pollVote": return [ diff --git a/packages/sw/src/scripts/lang.ts b/packages/sw/src/scripts/lang.ts index da4f31526..31cfb7bd3 100644 --- a/packages/sw/src/scripts/lang.ts +++ b/packages/sw/src/scripts/lang.ts @@ -1,7 +1,7 @@ /* * Language manager for SW */ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { get, set } from "idb-keyval"; import { I18n } from "@/scripts/i18n"; @@ -23,7 +23,7 @@ class SwLang { public i18n: Promise> | null = null; public fetchLocale() { - return (this.i18n = this._fetch()); + return this.i18n === this._fetch(); } private async _fetch() { diff --git a/packages/sw/src/scripts/notification-read.ts b/packages/sw/src/scripts/notification-read.ts index 5b2030d98..9ea452877 100644 --- a/packages/sw/src/scripts/notification-read.ts +++ b/packages/sw/src/scripts/notification-read.ts @@ -1,4 +1,4 @@ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { get } from "idb-keyval"; import { pushNotificationDataMap } from "@/types"; diff --git a/packages/sw/src/scripts/operations.ts b/packages/sw/src/scripts/operations.ts index a192a9bd7..ae76d6ecf 100644 --- a/packages/sw/src/scripts/operations.ts +++ b/packages/sw/src/scripts/operations.ts @@ -2,7 +2,7 @@ * Operations * 各種操作 */ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import * as Misskey from "calckey-js"; import { SwMessage, swMessageOrderType } from "@/types"; diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index 0733400fc..74603d67c 100644 --- a/packages/sw/src/sw.ts +++ b/packages/sw/src/sw.ts @@ -1,4 +1,4 @@ -declare var self: ServiceWorkerGlobalScope; +declare let self: ServiceWorkerGlobalScope; import { createEmptyNotification,