Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
refactor(settings): use secure context detection instead of just http
Browse files Browse the repository at this point in the history
  • Loading branch information
ttshivers committed Sep 28, 2020
1 parent 1fcbd55 commit 0ee57fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/TheSettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

<v-list-item
three-line
@click="isHttp ? null : CHANGE_NOTIFICATIONS_ENABLED(!ARE_NOTIFICATIONS_ENABLED)"
@click="isSecureContext ? CHANGE_NOTIFICATIONS_ENABLED(!ARE_NOTIFICATIONS_ENABLED) : null"
>
<v-list-item-content>
<v-list-item-title>Desktop Notifications</v-list-item-title>
Expand All @@ -94,14 +94,14 @@
<v-list-item-action>
<v-switch
hide-details
:input-value="ARE_NOTIFICATIONS_ENABLED && !isHttp"
:disabled="isHttp"
:input-value="ARE_NOTIFICATIONS_ENABLED && isSecureContext"
:disabled="!isSecureContext"
@change="CHANGE_NOTIFICATIONS_ENABLED"
@click.stop
/>

<v-tooltip
v-if="isHttp"
v-if="!isSecureContext"
bottom
>
<template #activator="{ on, attrs }">
Expand Down Expand Up @@ -343,8 +343,8 @@ export default {
return this.GET_PLEX_USER?.username;
},
isHttp() {
return window.location.protocol === 'http:';
isSecureContext() {
return window.isSecureContext;
},
BLOCKEDSERVERS: {
Expand Down

0 comments on commit 0ee57fc

Please sign in to comment.