diff --git a/app/models/notification.rb b/app/models/notification.rb index 01444ce61..c6bc43a2e 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -17,6 +17,7 @@ class Notification < ApplicationRecord def read update!(read_at: Time.current) + broadcast_read end def read? @@ -27,4 +28,8 @@ class Notification < ApplicationRecord def broadcast_unread broadcast_prepend_later_to user, :notifications, target: "notifications" end + + def broadcast_read + broadcast_remove_to user, :notifications + end end