Check for window.isSecureContext when determining Notification support
This commit is contained in:
committed by
Deluan Quintão
parent
7c23bd0890
commit
0d35148152
+1
-1
@@ -265,7 +265,7 @@
|
|||||||
"delete_user_title": "Delete user '%{name}'",
|
"delete_user_title": "Delete user '%{name}'",
|
||||||
"delete_user_content": "Are you sure you want to delete this user and all their data (including playlists and preferences)?",
|
"delete_user_content": "Are you sure you want to delete this user and all their data (including playlists and preferences)?",
|
||||||
"notifications_blocked": "You have blocked Notifications for this site in your browser's settings",
|
"notifications_blocked": "You have blocked Notifications for this site in your browser's settings",
|
||||||
"notifications_not_available": "This browser does not support desktop notifications"
|
"notifications_not_available": "This browser does not support desktop notifications or you are not accessing Navidrome over https"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"library": "Library",
|
"library": "Library",
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ const NotificationsToggle = () => {
|
|||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const notify = useNotify()
|
const notify = useNotify()
|
||||||
const currentSetting = useSelector((state) => state.settings.notifications)
|
const currentSetting = useSelector((state) => state.settings.notifications)
|
||||||
const notAvailable = !('Notification' in window)
|
const notAvailable = !('Notification' in window) || !window.isSecureContext
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(currentSetting && Notification.permission !== 'granted') ||
|
(currentSetting && Notification.permission !== 'granted') ||
|
||||||
|
|||||||
Reference in New Issue
Block a user