Update sw.ts

This commit is contained in:
syuilo 2023-09-03 14:12:56 +09:00
parent bfab383dca
commit 3e2b94a48d
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@
*/
import { get } from 'idb-keyval';
import * as misskey from 'misskey-js';
import * as Misskey from 'misskey-js';
import type { PushNotificationDataMap } from '@/types';
import { createEmptyNotification, createNotification } from '@/scripts/create-notification';
import { swLang } from '@/scripts/lang';
@ -99,7 +99,7 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv
if ('userId' in data.body) await swos.api('following/create', loginId, { userId: data.body.userId });
break;
case 'showUser':
if ('user' in data.body) client = await swos.openUser(Acct.toString(data.body.user), loginId);
if ('user' in data.body) client = await swos.openUser(Misskey.acct.toString(data.body.user), loginId);
break;
case 'reply':
if ('note' in data.body) client = await swos.openPost({ reply: data.body.note }, loginId);
@ -136,7 +136,7 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv
if ('note' in data.body) {
client = await swos.openNote(data.body.note.id, loginId);
} else if ('user' in data.body) {
client = await swos.openUser(Acct.toString(data.body.user), loginId);
client = await swos.openUser(Misskey.acct.toString(data.body.user), loginId);
}
break;
}