mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
fix the build
This commit is contained in:
parent
338d39265a
commit
5b2e7c8d10
@ -254,6 +254,8 @@ class ApplicationController < ActionController::Base
|
|||||||
if notifications.present?
|
if notifications.present?
|
||||||
notification_ids = notifications.split(",").map(&:to_i)
|
notification_ids = notifications.split(",").map(&:to_i)
|
||||||
Notification.read(current_user, notification_ids)
|
Notification.read(current_user, notification_ids)
|
||||||
|
current_user.reload
|
||||||
|
current_user.publish_notifications_state
|
||||||
cookies.delete('cn')
|
cookies.delete('cn')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -59,10 +59,11 @@ class NotificationsController < ApplicationController
|
|||||||
else
|
else
|
||||||
Notification.where(user_id: current_user.id).includes(:topic).where(read: false).update_all(read: true)
|
Notification.where(user_id: current_user.id).includes(:topic).where(read: false).update_all(read: true)
|
||||||
current_user.saw_notification_id(Notification.recent_report(current_user, 1).max.try(:id))
|
current_user.saw_notification_id(Notification.recent_report(current_user, 1).max.try(:id))
|
||||||
current_user.reload
|
|
||||||
current_user.publish_notifications_state
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
current_user.reload
|
||||||
|
current_user.publish_notifications_state
|
||||||
|
|
||||||
render json: success_json
|
render json: success_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,26 +58,20 @@ class Notification < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.mark_posts_read(user, topic_id, post_numbers)
|
def self.mark_posts_read(user, topic_id, post_numbers)
|
||||||
count = Notification
|
Notification
|
||||||
.where(user_id: user.id)
|
.where(user_id: user.id)
|
||||||
.where(topic_id: topic_id)
|
.where(topic_id: topic_id)
|
||||||
.where(post_number: post_numbers)
|
.where(post_number: post_numbers)
|
||||||
.where(read: false)
|
.where(read: false)
|
||||||
.update_all(read: true)
|
.update_all(read: true)
|
||||||
|
|
||||||
refresh_notification_count if count > 0
|
|
||||||
|
|
||||||
count
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.read(user, notification_ids)
|
def self.read(user, notification_ids)
|
||||||
count = Notification
|
Notification
|
||||||
.where(id: notification_ids)
|
.where(id: notification_ids)
|
||||||
.where(user_id: user.id)
|
.where(user_id: user.id)
|
||||||
.where(read: false)
|
.where(read: false)
|
||||||
.update_all(read: true)
|
.update_all(read: true)
|
||||||
|
|
||||||
refresh_notification_count if count > 0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.interesting_after(min_date)
|
def self.interesting_after(min_date)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user