diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index defe6410..b0088074 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -27,6 +27,7 @@ class NotificationsController < ApplicationController def read current_user.notifications.where(new: true).update_all(new: false) # rubocop:disable Rails/SkipsModelValidations + current_user.touch(:notifications_updated_at) respond_to do |format| format.turbo_stream do diff --git a/app/views/notifications/type/_nilclass.html.haml b/app/views/notifications/type/_nilclass.html.haml new file mode 100644 index 00000000..a6932516 --- /dev/null +++ b/app/views/notifications/type/_nilclass.html.haml @@ -0,0 +1,2 @@ +-# This is a stub to prevent errors on broken notifications on content being asynchronously destroyed. +- logger.error "Notification ##{notification.id} has a target which doesn't exist. (Target: #{notification.target_type}##{notification.target_id})"