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
*/
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<K extends keyof pushNotificationDataMap>(
*/
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<K extends keyof pushNotificationDataMap>(
],
},
];
}
case "mention":
return [
@ -157,7 +158,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
},
];
case "reaction":
case "reaction": {
let reaction = data.body.reaction;
let badge: string | undefined;
@ -214,6 +215,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
],
},
];
}
case "pollVote":
return [

View file

@ -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<I18n<any>> | null = null;
public fetchLocale() {
return (this.i18n = this._fetch());
return this.i18n === this._fetch();
}
private async _fetch() {

View file

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

View file

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

View file

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