mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Fix for browsers without SW (#805)
* Fix for browsers without SW * Improve check
This commit is contained in:
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…
x
Reference in New Issue
Block a user