app/assets/javascripts/hyrax/app.js.erb in hyrax-2.0.0.beta3 vs app/assets/javascripts/hyrax/app.js.erb in hyrax-2.0.0.beta4
- old
+ new
@@ -89,10 +89,11 @@
// ActionCable for user notifications. This is displayed in the navbar.
notifications: function() {
// Do not create a consumer if user is not logged in
if ($("meta[name='current-user']").length === 0)
return;
+ <% if Hyrax.config.realtime_notifications? %>
var consumer = ActionCable.createConsumer("<%= Hyrax::Engine.routes.url_helpers.notifications_endpoint_path %>");
consumer.subscriptions.create("Hyrax::NotificationsChannel", {
connected: function(data) {
this.perform("update_locale", { locale: $('html').attr('lang') });
},
@@ -100,9 +101,10 @@
received: function(data) {
var Notification = require('hyrax/notification');
new Notification($('.notify-number')).update(data.notifications_count, data.notifications_label);
}
});
+ <% end %>
},
// Search for a user to transfer a work to
transfers: function () {
$("#proxy_deposit_request_transfer_to").userSearch();