Просмотр исходного кода

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 лет назад
Родитель
Сommit
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;

Загрузка…
Отмена
Сохранить