forked from mystiq/hydrogen-web
remove obsolete code from refactoring before
This commit is contained in:
parent
a70a38f481
commit
f98369c4d6
1 changed files with 0 additions and 11 deletions
|
@ -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}`;
|
||||
|
|
Loading…
Reference in a new issue