mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fixed slack notifications handler
This commit is contained in:
parent
fdbfbfa985
commit
edc89d4b3d
1 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ interface IConfig {
|
|||
export class SlackNotificationsHandler {
|
||||
service: typeof SlackNotifications;
|
||||
private readonly enabled: boolean;
|
||||
constructor(service: typeof SlackNotifications, @Inject('config') config: IConfig) {
|
||||
constructor(@Inject('SlackNotifications') service: typeof SlackNotifications, @Inject('config') config: IConfig) {
|
||||
this.service = service;
|
||||
const hostSettings = config.get('hostSettings');
|
||||
this.enabled = hostSettings?.milestones?.url && hostSettings?.milestones?.enabled;
|
||||
|
@ -21,7 +21,7 @@ export class SlackNotificationsHandler {
|
|||
@HandleEvent(MilestoneCreatedEvent)
|
||||
async notifyMilestones(event: typeof MilestoneCreatedEvent) {
|
||||
if (!this.enabled) {
|
||||
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await this.service.notifyMilestoneReceived(event.data);
|
||||
|
|
Loading…
Add table
Reference in a new issue