mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +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 { getAppKey } from "../data/notify_html5";
|
||||
import { EventsMixin } from "../mixins/events-mixin";
|
||||
import { showPromptDialog } from "../dialogs/generic/show-dialog-box";
|
||||
import "./ha-switch";
|
||||
|
||||
export const pushSupported =
|
||||
@ -88,7 +89,10 @@ class HaPushNotificationsToggle extends EventsMixin(PolymerElement) {
|
||||
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) {
|
||||
this.pushChecked = false;
|
||||
return;
|
||||
|
@ -2676,7 +2676,11 @@
|
||||
"error_load_platform": "Configure notify.html5.",
|
||||
"error_use_https": "Requires SSL enabled for frontend.",
|
||||
"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": {
|
||||
"header": "Language",
|
||||
|
Loading…
x
Reference in New Issue
Block a user