DEV: always trigger 'notification_created' event.

And make prettier happy.
This commit is contained in:
Vinoth Kannan 2019-11-28 04:31:55 +05:30
parent bb31e7f5b6
commit 0fed417439
2 changed files with 6 additions and 13 deletions

View File

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

View File

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