From efc524085165f45674131c6cfdb6ccec7b7be587 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marl=C3=A8ne=20Simondant?= <msimondant@grandlyon.com>
Date: Fri, 10 Jan 2025 15:20:23 +0100
Subject: [PATCH] add a removeToast function

---
 src/app/services/notification.service.ts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/app/services/notification.service.ts b/src/app/services/notification.service.ts
index e23db1f78..6df03a5c3 100644
--- a/src/app/services/notification.service.ts
+++ b/src/app/services/notification.service.ts
@@ -24,13 +24,19 @@ export class NotificationService {
   /**
    * By default, the error is displayed until clicked on.
    */
-  public showError(title: string, message = '', timeOut = 0): ActiveToast<unknown> {
+  public showError(title: string, message = '', timeOut = 0, options?: any): ActiveToast<unknown> {
     return this.toastr.error(message, title, {
       timeOut: timeOut,
       disableTimeOut: timeOut === 0,
+      enableHtml: true,
+      ...options,
     });
   }
 
+  public removeToast(toastId: number): void {
+    this.toastr.remove(toastId);
+  }
+
   public showInfo(title: string, message = '', timeOut = 10000): ActiveToast<unknown> {
     return this.toastr.info(message, title, {
       timeOut: timeOut,
-- 
GitLab