This commit is contained in:
tamaina 2021-02-10 01:54:07 +09:00
parent c44a29ebb7
commit f95ca164d6
11 changed files with 259 additions and 176 deletions

View file

@ -12,7 +12,7 @@ type pushNotificationsTypes = {
'readAllNotifications': undefined;
};
export default async function<T extends keyof pushNotificationsTypes>(userId: string, type: T, body: pushNotificationsTypes[T]) {
export async function pushNotification<T extends keyof pushNotificationsTypes>(userId: string, type: T, body: pushNotificationsTypes[T]) {
const meta = await fetchMeta();
if (!meta.enableServiceWorker || meta.swPublicKey == null || meta.swPrivateKey == null) return;