feat: notifies user of bad RD download (failed for copyright, etc.)
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 13s
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 13s
This commit is contained in:
@@ -24,10 +24,10 @@ readonly class Broadcaster
|
||||
private LoggerInterface $logger,
|
||||
) {}
|
||||
|
||||
public function alert(string $title, string $message, string $type = "success", bool $sendPush = false): void
|
||||
public function alert(string $title, string $message, string $type = "success", bool $sendPush = false, ?string $mercureAlertTopic = null): void
|
||||
{
|
||||
try {
|
||||
$userAlertTopic = $this->requestStack->getCurrentRequest()->getSession()->get('mercure_alert_topic');
|
||||
$userAlertTopic = $mercureAlertTopic ?? $this->requestStack->getCurrentRequest()->getSession()->get('mercure_alert_topic');
|
||||
$update = new Update(
|
||||
$userAlertTopic,
|
||||
$this->renderer->render('broadcast/Alert.stream.html.twig', [
|
||||
@@ -39,7 +39,7 @@ readonly class Broadcaster
|
||||
);
|
||||
$this->hub->publish($update);
|
||||
} catch (\Throwable $exception) {
|
||||
// ToDo: look for better handling to get message to end user
|
||||
$this->logger->error('Unable to publish alert: ' . $exception->getMessage());
|
||||
}
|
||||
|
||||
if (true === $sendPush && in_array($this->notificationTransport, ['ntfy'])) {
|
||||
|
||||
Reference in New Issue
Block a user