nanka iroiro
This commit is contained in:
parent
e0dc391cf6
commit
de472fdc79
8 changed files with 163 additions and 158 deletions
|
|
@ -1,7 +1,7 @@
|
|||
declare var self: ServiceWorkerGlobalScope;
|
||||
|
||||
import { get } from 'idb-keyval';
|
||||
import { pushNotificationData } from '../../types';
|
||||
import { pushNotificationDataMap } from '@client/sw/types';
|
||||
import { api } from './operations';
|
||||
|
||||
type Accounts = {
|
||||
|
|
@ -30,7 +30,7 @@ class SwNotificationReadManager {
|
|||
}
|
||||
|
||||
// プッシュ通知の既読をサーバーに送信
|
||||
public async read(data: pushNotificationData) {
|
||||
public async read<K extends keyof pushNotificationDataMap>(data: pushNotificationDataMap[K]) {
|
||||
if (data.type !== 'notification' || !(data.userId in this.accounts)) return;
|
||||
|
||||
const account = this.accounts[data.userId];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue