Browse Source

Removes unnecessary history.pushState if the welcome page is disabled and the user enter the base URL

master
hristoterezov 9 years ago
parent
commit
3d5af92c7a
1 changed files with 0 additions and 26 deletions
  1. 0
    26
      app.js

+ 0
- 26
app.js View File

24
 
24
 
25
 import UIEvents from './service/UI/UIEvents';
25
 import UIEvents from './service/UI/UIEvents';
26
 
26
 
27
-/**
28
- * Tries to push history state with the following parameters:
29
- * 'VideoChat', `Room: ${roomName}`, URL. If fail, prints the error and returns
30
- * it.
31
- */
32
-function pushHistoryState(roomName, URL) {
33
-    try {
34
-        window.history.pushState(
35
-            'VideoChat', `Room: ${roomName}`, URL
36
-        );
37
-    } catch (e) {
38
-        console.warn("Push history state failed with parameters:",
39
-            'VideoChat', `Room: ${roomName}`, URL, e);
40
-        return e;
41
-    }
42
-    return null;
43
-}
44
-
45
 /**
27
 /**
46
  * Builds and returns the room name.
28
  * Builds and returns the room name.
47
  */
29
  */
51
     if(!roomName) {
33
     if(!roomName) {
52
         let word = RoomnameGenerator.generateRoomWithoutSeparator();
34
         let word = RoomnameGenerator.generateRoomWithoutSeparator();
53
         roomName = word.toLowerCase();
35
         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
-        }
62
     }
36
     }
63
 
37
 
64
     return roomName;
38
     return roomName;

Loading…
Cancel
Save