From f98369c4d6e37f43a18a7160ea3907b47ecfd023 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 25 Mar 2021 10:07:42 +0100 Subject: [PATCH] remove obsolete code from refactoring before --- src/platform/web/service-worker.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/platform/web/service-worker.js b/src/platform/web/service-worker.js index 3a68d125..ebfddf71 100644 --- a/src/platform/web/service-worker.js +++ b/src/platform/web/service-worker.js @@ -224,7 +224,6 @@ async function handlePushNotification(n) { const sessionId = n.session_id; let sender = n.sender_display_name || n.sender; if (sender && n.event_id) { - const clientList = await self.clients.matchAll({type: "window"}); const roomId = n.room_id; const hasFocusedClientOnRoom = !!await findClient(async client => { if (client.visibilityState === "visible" && client.focused) { @@ -235,16 +234,6 @@ async function handlePushNotification(n) { console.log("client is focused, room is open, don't show notif"); return; } - for (const client of clientList) { - // if the app is open and focused, don't show a notif when looking at the room already - if (client.visibilityState === "visible" && client.focused) { - const isRoomOpen = await sendAndWaitForReply(client, "hasRoomOpen", {sessionId, roomId}); - if (isRoomOpen) { - console.log("client is focused, room is open, don't show notif"); - return; - } - } - } let label; if (n.room_name) { label = `${sender} wrote you in ${n.room_name}`;