Skip to content

Commit 004efe6

Browse files
committed
Notifications channel on (not yet working)
1 parent a4c7055 commit 004efe6

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

app/javascript/channels/notification_counts_channel.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
import consumer from "./consumer"
33

44
consumer.subscriptions.create("NotificationCountsChannel", {
5+
connected(e) {
6+
console.log('Connected to NotificationCountsChannel')
7+
},
8+
59
received(data) {
610
this.badge.html(data["count"] == 0 ? "" : data["count"]);
711
this.badge.data("count", data["count"]);

app/models/notification.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ class Notification < ApplicationRecord
44
belongs_to :linkeable, polymorphic: true, optional: true
55

66
after_create(:send_email_notification)
7-
### after_create(:broadcast_web_notification)
8-
### after_save(:broadcast_notification_count)
7+
after_save(:broadcast_notification_count)
8+
# TODO
9+
# Activate
10+
## after_create(:broadcast_web_notification)
911

1012
private
1113

config/cable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ test:
66

77
production:
88
adapter: redis
9-
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10-
channel_prefix: candidatus_excubia_production
9+
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379" } %>
10+
# channel_prefix: candidatus_excubia_production

0 commit comments

Comments
 (0)