From 85dedf03ceda52116a139165fd07ae44215e790d Mon Sep 17 00:00:00 2001 From: RobinLinus Date: Wed, 16 Dec 2020 04:16:53 +0100 Subject: [PATCH] Cleanup --- client/scripts/network.js | 4 ++-- client/scripts/ui.js | 4 ++-- client/styles.css | 1 + server/index.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/scripts/network.js b/client/scripts/network.js index db19f4b..3774cc7 100644 --- a/client/scripts/network.js +++ b/client/scripts/network.js @@ -41,8 +41,8 @@ class ServerConnection { case 'ping': this.send({ type: 'pong' }); break; - case 'displayName': - Events.fire('displayName', msg); + case 'display-name': + Events.fire('display-name', msg); break; default: console.error('WS: unkown message type', msg); diff --git a/client/scripts/ui.js b/client/scripts/ui.js index 030b2a6..c0550af 100644 --- a/client/scripts/ui.js +++ b/client/scripts/ui.js @@ -6,8 +6,8 @@ window.isProductionEnvironment = !window.location.host.startsWith('localhost'); window.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; // set display name -Events.on('displayName', e => { - $("displayName").textContent = "You are known as " + e.detail.message; +Events.on('display-name', e => { + $('displayName').textContent = 'You are known as ' + e.detail.message; }); class PeersUI { diff --git a/client/styles.css b/client/styles.css index 78a5b19..b9d9898 100644 --- a/client/styles.css +++ b/client/styles.css @@ -593,6 +593,7 @@ x-instructions { opacity: 0.5; transition: opacity 300ms; z-index: -1; + text-align: center; } x-instructions:before { diff --git a/server/index.js b/server/index.js index 9f0e494..3279c0f 100644 --- a/server/index.js +++ b/server/index.js @@ -19,7 +19,7 @@ class SnapdropServer { this._keepAlive(peer); // send displayName - this._send(peer, { type: 'displayName', message: peer.name.displayName }); + this._send(peer, { type: 'display-name', message: peer.name.displayName }); } _onHeaders(headers, response) {