chore: lint sw

This commit is contained in:
ThatOneCalculator 2023-06-06 21:01:28 -07:00
parent aae5190186
commit fb19cea0ba
5 changed files with 10 additions and 8 deletions

View file

@ -1,7 +1,7 @@
/* /*
* Notification manager for SW * Notification manager for SW
*/ */
declare var self: ServiceWorkerGlobalScope; declare let self: ServiceWorkerGlobalScope;
import { swLang } from "@/scripts/lang"; import { swLang } from "@/scripts/lang";
import { cli } from "@/scripts/operations"; import { cli } from "@/scripts/operations";
@ -45,7 +45,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
*/ */
case "notification": case "notification":
switch (data.body.type) { switch (data.body.type) {
case "follow": case "follow": {
// users/showの型定義をswos.apiへ当てはめるのが困難なのでapiFetch.requestを直接使用 // users/showの型定義をswos.apiへ当てはめるのが困難なのでapiFetch.requestを直接使用
const account = await getAccountFromId(data.userId); const account = await getAccountFromId(data.userId);
if (!account) return null; if (!account) return null;
@ -71,6 +71,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
], ],
}, },
]; ];
}
case "mention": case "mention":
return [ return [
@ -157,7 +158,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
}, },
]; ];
case "reaction": case "reaction": {
let reaction = data.body.reaction; let reaction = data.body.reaction;
let badge: string | undefined; let badge: string | undefined;
@ -214,6 +215,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
], ],
}, },
]; ];
}
case "pollVote": case "pollVote":
return [ return [

View file

@ -1,7 +1,7 @@
/* /*
* Language manager for SW * Language manager for SW
*/ */
declare var self: ServiceWorkerGlobalScope; declare let self: ServiceWorkerGlobalScope;
import { get, set } from "idb-keyval"; import { get, set } from "idb-keyval";
import { I18n } from "@/scripts/i18n"; import { I18n } from "@/scripts/i18n";
@ -23,7 +23,7 @@ class SwLang {
public i18n: Promise<I18n<any>> | null = null; public i18n: Promise<I18n<any>> | null = null;
public fetchLocale() { public fetchLocale() {
return (this.i18n = this._fetch()); return this.i18n === this._fetch();
} }
private async _fetch() { private async _fetch() {

View file

@ -1,4 +1,4 @@
declare var self: ServiceWorkerGlobalScope; declare let self: ServiceWorkerGlobalScope;
import { get } from "idb-keyval"; import { get } from "idb-keyval";
import { pushNotificationDataMap } from "@/types"; import { pushNotificationDataMap } from "@/types";

View file

@ -2,7 +2,7 @@
* Operations * Operations
* *
*/ */
declare var self: ServiceWorkerGlobalScope; declare let self: ServiceWorkerGlobalScope;
import * as Misskey from "calckey-js"; import * as Misskey from "calckey-js";
import { SwMessage, swMessageOrderType } from "@/types"; import { SwMessage, swMessageOrderType } from "@/types";

View file

@ -1,4 +1,4 @@
declare var self: ServiceWorkerGlobalScope; declare let self: ServiceWorkerGlobalScope;
import { import {
createEmptyNotification, createEmptyNotification,