瀏覽代碼

Only push to history with present page URL plus room name

Use location.href instead of location.pathname to make the URL absolute
j8
Aaron van Meerten 9 年之前
父節點
當前提交
c2eede2bb5
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3
    8
      app.js

+ 3
- 8
app.js 查看文件

@@ -51,14 +51,9 @@ function buildRoomName () {
51 51
     if(!roomName) {
52 52
         let word = RoomnameGenerator.generateRoomWithoutSeparator();
53 53
         roomName = word.toLowerCase();
54
-        let historyURL = window.location.pathname + word;
55
-        //Trying to push state with URL "/" + roomName
56
-        var err = pushHistoryState(word, historyURL);
57
-        //If URL "/" + roomName is not good, trying with explicitly adding the
58
-        //domain name.
59
-        if(err && config.hosts.domain) {
60
-            pushHistoryState(word, "//" + config.hosts.domain + historyURL);
61
-        }
54
+        let historyURL = window.location.href + word;
55
+        //Trying to push state with current URL + roomName
56
+        pushHistoryState(word, historyURL);
62 57
     }
63 58
 
64 59
     return roomName;

Loading…
取消
儲存