From 046637a0754f0e7bd30ddcfb17b15cab29b1b3c5 Mon Sep 17 00:00:00 2001 From: Alexander Goedde Date: Thu, 30 Mar 2017 18:48:31 +0200 Subject: [PATCH] adds initial setting of channel to chat demo when no channel in URL --- demos/chat/js/chat.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/chat/js/chat.js b/demos/chat/js/chat.js index c2932a62..d4c93619 100644 --- a/demos/chat/js/chat.js +++ b/demos/chat/js/chat.js @@ -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(); @@ -131,7 +131,7 @@ function connect() { sess = session; sess.prefix("api", demoPrefix + ".chat"); - + if (details.x_cb_node_id) { updateStatusline("Connected to node " + details.x_cb_node_id + " at " + wsuri); } else { @@ -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"); } }