mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -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
|
* 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 [
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
declare var self: ServiceWorkerGlobalScope;
|
declare let self: ServiceWorkerGlobalScope;
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createEmptyNotification,
|
createEmptyNotification,
|
||||||
|
|
Loading…
Reference in a new issue