mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +00:00
Fix startup notifications
This commit is contained in:
parent
2518b1a79d
commit
24f9944319
@ -8,6 +8,8 @@ import type { HaToast } from "../components/ha-toast";
|
||||
import type { HomeAssistant } from "../types";
|
||||
|
||||
export interface ShowToastParams {
|
||||
// Unique ID for the toast. If a new toast is shown with the same ID as the previous toast, it will be replaced to avoid flickering.
|
||||
id?: string;
|
||||
message: string;
|
||||
action?: ToastActionParams;
|
||||
duration?: number;
|
||||
@ -27,7 +29,9 @@ class NotificationManager extends LitElement {
|
||||
@query("ha-toast") private _toast!: HaToast | undefined;
|
||||
|
||||
public async showDialog(parameters: ShowToastParams) {
|
||||
this._toast?.close();
|
||||
if (!parameters.id || this._parameters?.id !== parameters.id) {
|
||||
this._toast?.close();
|
||||
}
|
||||
|
||||
if (!parameters || parameters.duration === 0) {
|
||||
this._parameters = undefined;
|
||||
|
@ -143,6 +143,7 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
)[0][0];
|
||||
|
||||
showToast(this, {
|
||||
id: "integration_starting",
|
||||
message:
|
||||
this.hass!.localize("ui.notification_toast.integration_starting", {
|
||||
integration: domainToName(this.hass!.localize, integration),
|
||||
|
Loading…
x
Reference in New Issue
Block a user