From 2f414d6f72ee354ea6f51fb6666922cce0bc401e Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Tue, 7 May 2024 18:23:49 -0400 Subject: [PATCH] PM-7392 - ToastService - we need to await the activeToast.onHidden observable so return the activeToast from the showToast. --- libs/components/src/toast/toast.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/components/src/toast/toast.service.ts b/libs/components/src/toast/toast.service.ts index 8bbff02c41..8c519194f9 100644 --- a/libs/components/src/toast/toast.service.ts +++ b/libs/components/src/toast/toast.service.ts @@ -1,5 +1,5 @@ import { Injectable } from "@angular/core"; -import { IndividualConfig, ToastrService } from "ngx-toastr"; +import { ActiveToast, IndividualConfig, ToastrService } from "ngx-toastr"; import type { ToastComponent } from "./toast.component"; import { calculateToastTimeout } from "./utils"; @@ -18,7 +18,7 @@ export type ToastOptions = { export class ToastService { constructor(private toastrService: ToastrService) {} - showToast(options: ToastOptions) { + showToast(options: ToastOptions): ActiveToast { const toastrConfig: Partial = { payload: { message: options.message, @@ -31,7 +31,7 @@ export class ToastService { : calculateToastTimeout(options.message), }; - this.toastrService.show(null, options.title, toastrConfig); + return this.toastrService.show(null, options.title, toastrConfig); } /**