diff --git a/src/components/ha-push-notifications-toggle.js b/src/components/ha-push-notifications-toggle.js index 61aec06691..d50e1a16af 100644 --- a/src/components/ha-push-notifications-toggle.js +++ b/src/components/ha-push-notifications-toggle.js @@ -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; diff --git a/src/translations/en.json b/src/translations/en.json index f73cf09a3c..4136d5b2ea 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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",