From 7feb64935d5dce7f672f7691ae4823bd0b63ebd5 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 5 Jan 2022 02:48:36 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=A4=E3=82=A2=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=E3=82=89=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=83=BC=E3=83=A0=E3=81=AB=E6=8E=A5=E7=B6=9A?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=81=A8=E3=81=84=E3=81=86?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=AA=E3=81=AE=E3=81=A7=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E5=88=A4=E5=AE=9A=E3=81=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sw/src/lib.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/sw/src/lib.ts b/packages/sw/src/lib.ts index e2534613de..57859018df 100644 --- a/packages/sw/src/lib.ts +++ b/packages/sw/src/lib.ts @@ -57,17 +57,15 @@ self.lib.onpush = (ev: ServiceWorkerGlobalScopeEventMap['push']) => { includeUncontrolled: true, type: 'window' }).then(async (clients: readonly WindowClient[]) => { - // // クライアントがあったらストリームに接続しているということなので通知しない - // if (clients.length != 0) return; - const data: pushNotificationDataMap[K] = ev.data?.json(); switch (data.type) { // case 'driveFileCreated': case 'notification': case 'unreadMessagingMessage': + // クライアントがあったらストリームに接続しているということなので通知しない + if (clients.length != 0) return; return createNotification(data); - case 'readAllNotifications': for (const n of await self.registration.getNotifications()) { if (n?.data?.type === 'notification') n.close();