diff options
Diffstat (limited to 'shardweb/assets/js/app.js')
-rw-r--r-- | shardweb/assets/js/app.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shardweb/assets/js/app.js b/shardweb/assets/js/app.js index 53a0112..3adae5a 100644 --- a/shardweb/assets/js/app.js +++ b/shardweb/assets/js/app.js @@ -20,10 +20,10 @@ import "phoenix_html" import socket from "./socket" -var room_name = window.Gon.getAsset('chat_room'); -if (room_name != undefined) +var chat_channel = window.Gon.getAsset('chat_channel'); +if (chat_channel != undefined) { - var channel = socket.channel('room:' + room_name, {}); // connect to chat "room" + var channel = socket.channel(chat_channel, {}); // connect to chat "room" channel.on('shout', function (payload) { // listen to the 'shout' event var li = document.createElement("li"); // creaet new list item DOM element |