PM-7392 - ToastService - we need to await the activeToast.onHidden observable so return the activeToast from the showToast.

This commit is contained in:
Jared Snider 2024-05-07 18:23:49 -04:00
parent 0ef0bd3f1d
commit 2f414d6f72
No known key found for this signature in database
GPG Key ID: A149DDD612516286
1 changed files with 3 additions and 3 deletions

View File

@ -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<any> {
const toastrConfig: Partial<IndividualConfig> = {
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);
}
/**