mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 03:17:38 -07:00
chore: lint sw
This commit is contained in:
parent
aae5190186
commit
fb19cea0ba
5 changed files with 10 additions and 8 deletions
|
@ -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 [
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
declare var self: ServiceWorkerGlobalScope;
|
||||
declare let self: ServiceWorkerGlobalScope;
|
||||
|
||||
import { get } from "idb-keyval";
|
||||
import { pushNotificationDataMap } from "@/types";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Operations
|
||||
* 各種操作
|
||||
*/
|
||||
declare var self: ServiceWorkerGlobalScope;
|
||||
declare let self: ServiceWorkerGlobalScope;
|
||||
|
||||
import * as Misskey from "calckey-js";
|
||||
import { SwMessage, swMessageOrderType } from "@/types";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
declare var self: ServiceWorkerGlobalScope;
|
||||
declare let self: ServiceWorkerGlobalScope;
|
||||
|
||||
import {
|
||||
createEmptyNotification,
|
||||
|
|
Loading…
Reference in a new issue