aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-17 19:46:37 +0300
committerGravatar Vitaly Takmazov2018-02-17 19:46:37 +0300
commit318f19c63477e7ba21cf1abc62e62a5249c670a7 (patch)
tree0c5e84aecf3446cbed87880be371ec3e0c5dd5d4
parent02f2b569164bf5e89245af2dbef39d0033a862ad (diff)
www: fix ws for visitors
-rw-r--r--juick-www/src/main/static/scripts.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index 6a2ba370..588e4fdb 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -131,7 +131,13 @@ function initWS() {
if (hash) {
url += '?hash=' + hash;
} else {
- url += pageMID;
+ let content = document.getElementById('content');
+ if (content) {
+ let pageMID = content.getAttribute('data-mid');
+ if (pageMID) {
+ url += pageMID;
+ }
+ }
}
ws = new WebSocket(url);