From d3a623d352fc0f82f0aab32ce68f40c4d5f421d6 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Fri, 15 Dec 2023 21:19:56 +0100 Subject: [PATCH] Refactor for loops to specify imagesOnly to Array.prototype.every() --- public/scripts/ui.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 52fecbc..ae63a0e 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -2420,14 +2420,9 @@ class Notifications { _downloadNotification(files) { if (document.visibilityState !== 'visible') { - let imagesOnly = true; - for(let i=0; i file.type.split('/')[0] === 'image'); let title; + if (files.length === 1) { title = `${files[0].name}`; } @@ -2452,15 +2447,8 @@ class Notifications { _requestNotification(request, peerId) { if (document.visibilityState !== 'visible') { - let imagesOnly = true; - for(let i=0; i header.mime.split('/')[0] === 'image'); + let displayName = $(peerId).querySelector('.name').textContent; let descriptor; if (request.header.length === 1) {