fix actioncable issue

This commit is contained in:
Josh 2017-06-12 13:35:00 -04:00
parent b1e65e4ca7
commit 206f293194
2 changed files with 34 additions and 28 deletions

View File

@ -119,7 +119,13 @@ joinMeeting = function(meeting_name){
}
// Only need to register for logged in users.
if($('body').data('current-user')){
$(document).on('turbolinks:load', function(){
if($('body').data('current-user')){
MEETINGS = {}
$('.actives').empty();
if(!App.messages){
App.messages = App.cable.subscriptions.create('RefreshMeetingsChannel', {
received: function(data) {
console.log('Recieved ' + data['method'] + ' action for ' + data['meeting'] + '.')
@ -145,7 +151,9 @@ if($('body').data('current-user')){
}
}
});
}
console.log('Populating active meetings.');
setTimeout(initialPopulate, LOADING_DELAY);
}
}
});

View File

@ -46,5 +46,3 @@
</div>
</div>
<% end %>
<%= javascript_include_tag "active_meetings.js" %>