瀏覽代碼

Fix race condition

Paul Szymanski 4 年之前
父節點
當前提交
229df6f3d6
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      client/scripts/ui.js

+ 5 - 5
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;
-        });
     }
 }