Fix notification content not loading

This commit is contained in:
Braydon 2024-06-21 01:23:35 -04:00
parent 8ee8e53ef5
commit 5838f4b895

@ -1,5 +1,6 @@
package me.braydon.profanity.service; package me.braydon.profanity.service;
import jakarta.annotation.PostConstruct;
import lombok.NonNull; import lombok.NonNull;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import me.braydon.profanity.model.response.ContentProcessResponse; import me.braydon.profanity.model.response.ContentProcessResponse;
@ -38,7 +39,7 @@ public class ModerationService {
/** /**
* The content to display within notifications. * The content to display within notifications.
*/ */
@NonNull private final NotificationContent notificationContent; private NotificationContent notificationContent;
/** /**
* The registered notification sources to alert. * The registered notification sources to alert.
@ -47,10 +48,14 @@ public class ModerationService {
@Autowired @Autowired
public ModerationService(@NonNull List<INotificationSource> notificationSources) { public ModerationService(@NonNull List<INotificationSource> notificationSources) {
notificationContent = new NotificationContent(displayContent, displayMatched, displayTags, displayScore);
this.notificationSources = notificationSources; this.notificationSources = notificationSources;
} }
@PostConstruct
public void onInitialize() {
notificationContent = new NotificationContent(displayContent, displayMatched, displayTags, displayScore);
}
/** /**
* Handle alerts for the given response. * Handle alerts for the given response.
* <p> * <p>