From 98a6f63799ab486e7053bf1fe367ec27ad135719 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Fri, 6 Jan 2023 15:09:01 +0100 Subject: [PATCH] remove notification for new displayName as peerId and display name is persistent again --- public/scripts/network.js | 6 +++--- public/scripts/ui.js | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/public/scripts/network.js b/public/scripts/network.js index adbd381..ec941dc 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -43,7 +43,7 @@ class ServerConnection { this.send({ type: 'pong' }); break; case 'display-name': - sessionStorage.setItem("peer_id", msg.message.peerId); + sessionStorage.setItem("peerId", msg.message.peerId); Events.fire('display-name', msg); break; default: @@ -61,8 +61,8 @@ class ServerConnection { const protocol = location.protocol.startsWith('https') ? 'wss' : 'ws'; const webrtc = window.isRtcSupported ? '/webrtc' : '/fallback'; let url = new URL(protocol + '://' + location.host + location.pathname + 'server' + webrtc); - if (sessionStorage.getItem('peer_id')) { - url.searchParams.append('peer_id', sessionStorage.getItem('peer_id')) + if (sessionStorage.getItem('peerId')) { + url.searchParams.append('peer_id', sessionStorage.getItem('peerId')) } return url.toString(); } diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 4659967..4fc01a1 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -9,9 +9,6 @@ window.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; Events.on('display-name', e => { const me = e.detail.message; const $displayName = $('displayName') - if ($displayName.textContent !== '') { - Events.fire('notify-user', 'Your name has changed.'); - } $displayName.textContent = 'You are known as ' + me.displayName; $displayName.title = me.deviceName; });