Skip to content

Commit

Permalink
adds initial setting of channel to chat demo when no channel in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Goedde committed Mar 30, 2017
1 parent 2229829 commit 046637a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions demos/chat/js/chat.js
Expand Up @@ -60,7 +60,7 @@ var windowUrl = document.URL; // string
if (windowUrl.indexOf('#') !== -1) {
initialChannel = windowUrl.split('#')[1];
} else {
console.log("no fragment yet");
window.location.hash = "ch1";
}

setupDemo();
Expand Down Expand Up @@ -131,7 +131,7 @@ function connect() {
sess = session;

sess.prefix("api", demoPrefix + ".chat");

if (details.x_cb_node_id) {
updateStatusline("Connected to node <strong>" + details.x_cb_node_id + "</strong> at " + wsuri);
} else {
Expand All @@ -152,11 +152,11 @@ function connect() {
connection.onclose = function(reason, details) {
sess = null;
console.log("connection closed ", reason, details);

if (details.will_retry) {
updateStatusline("Trying to reconnect in " + parseInt(details.retry_delay) + " s.");
} else {
updateStatusline("Disconnected");
updateStatusline("Disconnected");
}
}

Expand Down

0 comments on commit 046637a

Please sign in to comment.