From 229df6f3d6f02b517d442226b316e6faf61f20e3 Mon Sep 17 00:00:00 2001 From: Paul Szymanski <519954+PaulSzymanski@users.noreply.github.com> Date: Sun, 12 Jul 2020 19:23:07 +0200 Subject: [PATCH] Fix race condition --- client/scripts/ui.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/scripts/ui.js b/client/scripts/ui.js index 62964b1..0996d70 100644 --- a/client/scripts/ui.js +++ b/client/scripts/ui.js @@ -5,6 +5,11 @@ window.isDownloadSupported = (typeof document.createElement('a').download !== 'u 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; +}); + class PeersUI { constructor() { @@ -492,11 +497,6 @@ class Snapdrop { const networkStatusUI = new NetworkStatusUI(); const webShareTargetUI = new WebShareTargetUI(); }); - - // set display name - Events.on('displayName', e => { - $("displayName").textContent = "You are known as " + e.detail.message; - }); } }