Merge pull request #1203 from Retrospring/fix/notification-bugs

Notification dropdown fixes
This commit is contained in:
Karina Kwiatek 2023-05-08 19:16:33 +02:00 committed by GitHub
commit 333af458db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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})"