refactor: no reactivity transform (#2600)
This commit is contained in:
parent
b9394c2fa5
commit
ccfa7a8d10
102 changed files with 649 additions and 652 deletions
|
@ -14,7 +14,7 @@ const supportsPushNotifications = typeof window !== 'undefined'
|
|||
&& 'getKey' in PushSubscription.prototype
|
||||
|
||||
export function usePushManager() {
|
||||
const { client } = $(useMasto())
|
||||
const { client } = useMasto()
|
||||
const isSubscribed = ref(false)
|
||||
const notificationPermission = ref<PermissionState | undefined>(
|
||||
Notification.permission === 'denied'
|
||||
|
@ -25,7 +25,7 @@ export function usePushManager() {
|
|||
? 'prompt'
|
||||
: undefined,
|
||||
)
|
||||
const isSupported = $computed(() => supportsPushNotifications)
|
||||
const isSupported = computed(() => supportsPushNotifications)
|
||||
const hiddenNotification = useLocalStorage<PushNotificationRequest>(STORAGE_KEY_NOTIFICATION, {})
|
||||
const configuredPolicy = useLocalStorage<PushNotificationPolicy>(STORAGE_KEY_NOTIFICATION_POLICY, {})
|
||||
const pushNotificationData = ref(createRawSettings(
|
||||
|
@ -173,7 +173,7 @@ export function usePushManager() {
|
|||
if (policyChanged)
|
||||
await subscribe(data, policy, true)
|
||||
else
|
||||
currentUser.value.pushSubscription = await client.v1.push.subscription.update({ data })
|
||||
currentUser.value.pushSubscription = await client.value.v1.push.subscription.update({ data })
|
||||
|
||||
policyChanged && await nextTick()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue