mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: Track first notification read using Redis.
This commit is contained in:
parent
c4e3ab21dd
commit
98c1e0832c
3 changed files with 54 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue