remove forceDisconnect() and add change name notification

This commit is contained in:
schlagmichdoch 2022-12-30 22:55:48 +01:00
parent cb86e96ffc
commit 1b7aced340
2 changed files with 8 additions and 10 deletions

View file

@ -9,6 +9,9 @@ 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;
});
@ -65,6 +68,7 @@ class PeersUI {
_clearPeers() {
const $peers = $$('x-peers').innerHTML = '';
Object.keys(this.peers).forEach(peerId => delete this.peers[peerId]);
setTimeout(e => window.animateBackground(true), 1750); // Start animation again
}
_onPaste(e) {