mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Replace prompt with showPromptDialog (#7460)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
b56e9ef028
commit
ba4c2fc1bd
@ -3,6 +3,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag";
|
|||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
import { getAppKey } from "../data/notify_html5";
|
import { getAppKey } from "../data/notify_html5";
|
||||||
import { EventsMixin } from "../mixins/events-mixin";
|
import { EventsMixin } from "../mixins/events-mixin";
|
||||||
|
import { showPromptDialog } from "../dialogs/generic/show-dialog-box";
|
||||||
import "./ha-switch";
|
import "./ha-switch";
|
||||||
|
|
||||||
export const pushSupported =
|
export const pushSupported =
|
||||||
@ -88,7 +89,10 @@ class HaPushNotificationsToggle extends EventsMixin(PolymerElement) {
|
|||||||
browserName = "chrome";
|
browserName = "chrome";
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = prompt("What should this device be called ?");
|
const name = await showPromptDialog(this, {
|
||||||
|
title: this.hass.localize("ui.panel.profile.push_notifications.add_device_prompt.title"),
|
||||||
|
inputLabel: this.hass.localize("ui.panel.profile.push_notifications.add_device_prompt.input_label"),
|
||||||
|
});
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
this.pushChecked = false;
|
this.pushChecked = false;
|
||||||
return;
|
return;
|
||||||
|
@ -2676,7 +2676,11 @@
|
|||||||
"error_load_platform": "Configure notify.html5.",
|
"error_load_platform": "Configure notify.html5.",
|
||||||
"error_use_https": "Requires SSL enabled for frontend.",
|
"error_use_https": "Requires SSL enabled for frontend.",
|
||||||
"push_notifications": "Push notifications",
|
"push_notifications": "Push notifications",
|
||||||
"link_promo": "Learn more"
|
"link_promo": "Learn more",
|
||||||
|
"add_device_prompt": {
|
||||||
|
"title": "What should this device be called?",
|
||||||
|
"input_label": "Device name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"header": "Language",
|
"header": "Language",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user