mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 02:04:53 +08:00
FIX: Track first notification read using Redis.
This commit is contained in:
@ -55,7 +55,10 @@ class Notification < ActiveRecord::Base
|
||||
read: false)
|
||||
.update_all("read = 't'")
|
||||
|
||||
user.publish_notifications_state if count > 0
|
||||
if count > 0
|
||||
user.mark_first_notification_read
|
||||
user.publish_notifications_state
|
||||
end
|
||||
|
||||
count
|
||||
end
|
||||
@ -64,7 +67,9 @@ class Notification < ActiveRecord::Base
|
||||
count = Notification.where(user_id: user.id,
|
||||
id: notification_ids,
|
||||
read: false).update_all(read: true)
|
||||
|
||||
if count > 0
|
||||
user.mark_first_notification_read
|
||||
user.publish_notifications_state
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user