mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 00:07:17 +00:00
Add warning for HTTPS requirement on notifications
This commit is contained in:
parent
98e8640932
commit
372d74db69
2 changed files with 11 additions and 0 deletions
|
@ -306,6 +306,7 @@
|
|||
<input
|
||||
id="desktopNotifications"
|
||||
:checked="$store.state.settings.desktopNotifications"
|
||||
:disabled="$store.state.desktopNotificationState === 'nohttps'"
|
||||
type="checkbox"
|
||||
name="desktopNotifications"
|
||||
/>
|
||||
|
@ -316,6 +317,14 @@
|
|||
>
|
||||
<strong>Warning</strong>: Notifications are not supported by your browser.
|
||||
</div>
|
||||
<div
|
||||
v-if="$store.state.desktopNotificationState === 'nohttps'"
|
||||
id="warnBlockedDesktopNotifications"
|
||||
class="error"
|
||||
>
|
||||
<strong>Warning</strong>: Notifications are only supported over HTTPS
|
||||
connections.
|
||||
</div>
|
||||
<div
|
||||
v-if="$store.state.desktopNotificationState === 'blocked'"
|
||||
id="warnBlockedDesktopNotifications"
|
||||
|
|
|
@ -12,6 +12,8 @@ function detectDesktopNotificationState() {
|
|||
return "unsupported";
|
||||
} else if (Notification.permission === "granted") {
|
||||
return "granted";
|
||||
} else if (!window.isSecureContext) {
|
||||
return "nohttps";
|
||||
}
|
||||
|
||||
return "blocked";
|
||||
|
|
Loading…
Reference in a new issue