mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-22 07:46:17 -04:00
remove notification for new displayName as peerId and display name is persistent again
This commit is contained in:
parent
621c525d11
commit
98a6f63799
2 changed files with 3 additions and 6 deletions
|
@ -43,7 +43,7 @@ class ServerConnection {
|
||||||
this.send({ type: 'pong' });
|
this.send({ type: 'pong' });
|
||||||
break;
|
break;
|
||||||
case 'display-name':
|
case 'display-name':
|
||||||
sessionStorage.setItem("peer_id", msg.message.peerId);
|
sessionStorage.setItem("peerId", msg.message.peerId);
|
||||||
Events.fire('display-name', msg);
|
Events.fire('display-name', msg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -61,8 +61,8 @@ class ServerConnection {
|
||||||
const protocol = location.protocol.startsWith('https') ? 'wss' : 'ws';
|
const protocol = location.protocol.startsWith('https') ? 'wss' : 'ws';
|
||||||
const webrtc = window.isRtcSupported ? '/webrtc' : '/fallback';
|
const webrtc = window.isRtcSupported ? '/webrtc' : '/fallback';
|
||||||
let url = new URL(protocol + '://' + location.host + location.pathname + 'server' + webrtc);
|
let url = new URL(protocol + '://' + location.host + location.pathname + 'server' + webrtc);
|
||||||
if (sessionStorage.getItem('peer_id')) {
|
if (sessionStorage.getItem('peerId')) {
|
||||||
url.searchParams.append('peer_id', sessionStorage.getItem('peer_id'))
|
url.searchParams.append('peer_id', sessionStorage.getItem('peerId'))
|
||||||
}
|
}
|
||||||
return url.toString();
|
return url.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,6 @@ window.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||||
Events.on('display-name', e => {
|
Events.on('display-name', e => {
|
||||||
const me = e.detail.message;
|
const me = e.detail.message;
|
||||||
const $displayName = $('displayName')
|
const $displayName = $('displayName')
|
||||||
if ($displayName.textContent !== '') {
|
|
||||||
Events.fire('notify-user', 'Your name has changed.');
|
|
||||||
}
|
|
||||||
$displayName.textContent = 'You are known as ' + me.displayName;
|
$displayName.textContent = 'You are known as ' + me.displayName;
|
||||||
$displayName.title = me.deviceName;
|
$displayName.title = me.deviceName;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue