Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/ha-push-notifications-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -88,7 +89,11 @@ 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.title"),
inputLabel: this.hass.localize("ui.panel.profile.push_notifications.add_device.text"),
Comment thread
TheZoker marked this conversation as resolved.
Outdated
inputType: "string"
Comment thread
TheZoker marked this conversation as resolved.
Outdated
});
if (name == null) {
this.pushChecked = false;
return;
Expand Down
6 changes: 5 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,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": {
Comment thread
TheZoker marked this conversation as resolved.
Outdated
"title": "What should this device be called?",
"text": "Please enter a name for the device"
Comment thread
TheZoker marked this conversation as resolved.
Outdated
}
},
"language": {
"header": "Language",
Expand Down