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) {
|
text(notificationName, data) {
|
||||||
return I18n.t(
|
return I18n.t("notifications.membership_request_consolidated", {
|
||||||
"notifications.membership_request_consolidated",
|
group_name: data.group_name,
|
||||||
{
|
count: parseInt(data.count, 10)
|
||||||
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 :refresh_notification_count, on: [:create, :update, :destroy]
|
||||||
|
|
||||||
after_commit(on: :create) do
|
after_commit(on: :create) do
|
||||||
consolidated = consolidate_membership_requests
|
DiscourseEvent.trigger(:notification_created, self)
|
||||||
|
send_email unless consolidate_membership_requests
|
||||||
unless consolidated
|
|
||||||
DiscourseEvent.trigger(:notification_created, self)
|
|
||||||
send_email
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.ensure_consistency!
|
def self.ensure_consistency!
|
||||||
|
|
Loading…
Reference in New Issue