push notifications fix
This commit is contained in:
parent
b485ccd82e
commit
ad52027760
1 changed files with 2 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ import { useUsersStore } from 'src/stores/users.js'
|
||||||
export const piniaPushNotificationsPlugin = ({ store }) => {
|
export const piniaPushNotificationsPlugin = ({ store }) => {
|
||||||
const validActions = {
|
const validActions = {
|
||||||
sync_config: new Set(['setPreference']),
|
sync_config: new Set(['setPreference']),
|
||||||
interface: new Set(['setNotificationPermission', 'setLoginStatus']),
|
interface: new Set(['setNotificationPermission', 'onLogin', 'onLogout']),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validActions[store.$id]) return // Not applicable to the store
|
if (!validActions[store.$id]) return // Not applicable to the store
|
||||||
|
|
@ -21,7 +21,7 @@ export const piniaPushNotificationsPlugin = ({ store }) => {
|
||||||
useInterfaceStore().notificationPermission === 'granted'
|
useInterfaceStore().notificationPermission === 'granted'
|
||||||
let permissionPresent =
|
let permissionPresent =
|
||||||
useInterfaceStore().notificationPermission !== undefined
|
useInterfaceStore().notificationPermission !== undefined
|
||||||
let user = !!useUsersStore().currentUser
|
let user = useUsersStore().loggedIn
|
||||||
|
|
||||||
if (store.$id === 'instance') {
|
if (store.$id === 'instance') {
|
||||||
if (actionName === 'set' && args[0].path === 'vapidPublicKey') {
|
if (actionName === 'set' && args[0].path === 'vapidPublicKey') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue