fix: minor tweaks to PushNotificationSettings (#1222)

This commit is contained in:
Nolan Lawson 2019-05-25 13:21:17 -07:00 committed by GitHub
parent 02689bec93
commit 92bff6caaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -9,7 +9,7 @@
<label for="push-notifications-follow">New followers</label>
<br>
<input type="checkbox" id="push-notifications-favourite" name="favourite" disabled="{!pushNotificationsSupport}" on:change="onPushSettingsChange(event)">
<label for="push-notifications-favourite">Favourites</label>
<label for="push-notifications-favourite">Favorites</label>
<br>
<input type="checkbox" id="push-notifications-reblog" name="reblog" disabled="{!pushNotificationsSupport}" on:change="onPushSettingsChange(event)">
<label for="push-notifications-reblog">Boosts</label>
@ -40,6 +40,7 @@
import { logOutOfInstance } from '../../../_actions/instances'
import { updatePushSubscriptionForInstance, updateAlerts } from '../../../_actions/pushSubscription'
import { toast } from '../../toast/toast'
import { get } from '../../../_utils/lodash-lite'
export default {
async oncreate () {
@ -49,10 +50,10 @@
const form = this.refs.pushNotificationsForm
const { pushSubscription } = this.store.get()
form.elements.follow.checked = pushSubscription && pushSubscription.alerts && pushSubscription.alerts.follow
form.elements.favourite.checked = pushSubscription && pushSubscription.alerts && pushSubscription.alerts.favourite
form.elements.reblog.checked = pushSubscription && pushSubscription.alerts && pushSubscription.alerts.reblog
form.elements.mention.checked = pushSubscription && pushSubscription.alerts && pushSubscription.alerts.mention
form.elements.follow.checked = get(pushSubscription, ['alerts', 'follow'])
form.elements.favourite.checked = get(pushSubscription, ['alerts', 'favourite'])
form.elements.reblog.checked = get(pushSubscription, ['alerts', 'reblog'])
form.elements.mention.checked = get(pushSubscription, ['alerts', 'mention'])
},
store: () => store,
computed: {