Parcourir la source

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 il y a 9 ans
Parent
révision
c2eede2bb5
1 fichiers modifiés avec 3 ajouts et 8 suppressions
  1. 3
    8
      app.js

+ 3
- 8
app.js Voir le fichier

@@ -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;

Chargement…
Annuler
Enregistrer