Skip to content

Commit

Permalink
Add a helper for the notifications that are marked read once seen
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgumberg committed Nov 8, 2023
1 parent fc2cae4 commit 694653b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/helpers/notifications_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module NotificationsHelper
def read_when_seen_notifications
["YouthBirthdayNotification", "VolunteerBirthdayNotification", "EmancipationChecklistReminderNotification"]
end

def notifications_after_and_including_deploy(notifications)
latest_deploy_time = Health.instance.latest_deploy_time

Expand Down
2 changes: 1 addition & 1 deletion app/views/notifications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>

<% @notifications.each do |notification| %>
<% if ["YouthBirthdayNotification", "VolunteerBirthdayNotification", "EmancipationChecklistReminderNotification"].include? notification.type %>
<% if read_when_seen_notifications.include? notification.type %>
<% notification.mark_as_read! %>
<% end %>
<% end %>

0 comments on commit 694653b

Please sign in to comment.