refactor: sync masto (#1121)
This commit is contained in:
parent
eb1f769e32
commit
4422a57f49
81 changed files with 397 additions and 367 deletions
|
@ -132,5 +132,5 @@ async function sendSubscriptionToBackend(
|
|||
data,
|
||||
}
|
||||
|
||||
return await useMasto().v1.webPushSubscriptions.create(params)
|
||||
return await useMastoClient().v1.webPushSubscriptions.create(params)
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ const supportsPushNotifications = typeof window !== 'undefined'
|
|||
&& 'getKey' in PushSubscription.prototype
|
||||
|
||||
export const usePushManager = () => {
|
||||
const masto = useMasto()
|
||||
const { client } = $(useMasto())
|
||||
const isSubscribed = ref(false)
|
||||
const notificationPermission = ref<PermissionState | undefined>(
|
||||
Notification.permission === 'denied'
|
||||
|
@ -168,7 +168,7 @@ export const usePushManager = () => {
|
|||
if (policyChanged)
|
||||
await subscribe(data, policy, true)
|
||||
else
|
||||
currentUser.value.pushSubscription = await masto.v1.webPushSubscriptions.update({ data })
|
||||
currentUser.value.pushSubscription = await client.v1.webPushSubscriptions.update({ data })
|
||||
|
||||
policyChanged && await nextTick()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue