parent
9131a7c7e3
commit
8b8ba5875f
|
@ -25,7 +25,7 @@ class HaPushNotificationsToggle extends window.hassMixins.EventsMixin(Polymer.El
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
notify: true,
|
notify: true,
|
||||||
value: (
|
value: (
|
||||||
'PushManager' in window &&
|
'serviceWorker' in navigator && 'PushManager' in window &&
|
||||||
(document.location.protocol === 'https:' ||
|
(document.location.protocol === 'https:' ||
|
||||||
document.location.hostname === 'localhost' ||
|
document.location.hostname === 'localhost' ||
|
||||||
document.location.hostname === '127.0.0.1')
|
document.location.hostname === '127.0.0.1')
|
||||||
|
@ -61,6 +61,7 @@ class HaPushNotificationsToggle extends window.hassMixins.EventsMixin(Polymer.El
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
handlePushChange(pushChecked) {
|
handlePushChange(pushChecked) {
|
||||||
|
if (!this.pushSupported) return;
|
||||||
if (pushChecked) {
|
if (pushChecked) {
|
||||||
this.subscribePushNotifications();
|
this.subscribePushNotifications();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue