Skip to content

Commit

Permalink
Merge pull request #1706 from samvera/do_not_ask_for_notifications_en…
Browse files Browse the repository at this point in the history
…dpoint_path_if_option_disabled

Do not ask for the notifications_endpoint_path when compiling assets
  • Loading branch information
elrayle authored Sep 21, 2017
2 parents a67ad24 + e3c22c0 commit 403401f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/hyrax/app.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Hyrax = {
// 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) {
Expand All @@ -102,6 +103,7 @@ Hyrax = {
new Notification($('.notify-number')).update(data.notifications_count, data.notifications_label);
}
});
<% end %>
},

// Search for a user to transfer a work to
Expand Down

0 comments on commit 403401f

Please sign in to comment.