DEV: always trigger 'notification_created' event.
And make prettier happy.
This commit is contained in:
parent
bb31e7f5b6
commit
0fed417439
|
@ -13,13 +13,10 @@ createWidgetFrom(
|
|||
},
|
||||
|
||||
text(notificationName, data) {
|
||||
return I18n.t(
|
||||
"notifications.membership_request_consolidated",
|
||||
{
|
||||
group_name: data.group_name,
|
||||
count: parseInt(data.count, 10)
|
||||
}
|
||||
);
|
||||
return I18n.t("notifications.membership_request_consolidated", {
|
||||
group_name: data.group_name,
|
||||
count: parseInt(data.count, 10)
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -26,12 +26,8 @@ class Notification < ActiveRecord::Base
|
|||
after_commit :refresh_notification_count, on: [:create, :update, :destroy]
|
||||
|
||||
after_commit(on: :create) do
|
||||
consolidated = consolidate_membership_requests
|
||||
|
||||
unless consolidated
|
||||
DiscourseEvent.trigger(:notification_created, self)
|
||||
send_email
|
||||
end
|
||||
DiscourseEvent.trigger(:notification_created, self)
|
||||
send_email unless consolidate_membership_requests
|
||||
end
|
||||
|
||||
def self.ensure_consistency!
|
||||
|
|
Loading…
Reference in New Issue