refactor: flatten composables and enable auto-imports on dirs (#608)
This commit is contained in:
parent
d569754b09
commit
aeb5a40948
14 changed files with 17 additions and 26 deletions
|
@ -1,4 +1,5 @@
|
|||
import type { AriaAnnounceType } from '~/composables/aria/types'
|
||||
export type AriaLive = 'off' | 'polite' | 'assertive'
|
||||
export type AriaAnnounceType = 'announce' | 'mute' | 'unmute'
|
||||
|
||||
const ariaAnnouncer = useEventBus<AriaAnnounceType, string | undefined>(Symbol('aria-announcer'))
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export type AriaLive = 'off' | 'polite' | 'assertive'
|
||||
export type AriaAnnounceType = 'announce' | 'mute' | 'unmute'
|
|
@ -1,7 +1,6 @@
|
|||
import type { Emoji } from 'masto'
|
||||
import type { CustomEmojisInfo } from './push-notifications/types'
|
||||
import { STORAGE_KEY_CUSTOM_EMOJIS } from '~/constants'
|
||||
import { useUserLocalStorage } from '~/composables/users'
|
||||
|
||||
const TTL = 1000 * 60 * 60 * 24 // 1 day
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@ import type {
|
|||
PushManagerSubscriptionInfo,
|
||||
RequiredUserLogin,
|
||||
} from '~/composables/push-notifications/types'
|
||||
import { useMasto } from '~/composables/masto'
|
||||
import { currentUser, removePushNotificationData, removePushNotifications } from '~/composables/users'
|
||||
|
||||
export const createPushSubscription = async (
|
||||
user: RequiredUserLogin,
|
||||
|
|
|
@ -5,14 +5,12 @@ import type {
|
|||
PushNotificationRequest,
|
||||
SubscriptionResult,
|
||||
} from '~/composables/push-notifications/types'
|
||||
import { createPushSubscription } from '~/composables/push-notifications/createPushSubscription'
|
||||
import { STORAGE_KEY_NOTIFICATION, STORAGE_KEY_NOTIFICATION_POLICY } from '~/constants'
|
||||
import { currentUser, removePushNotifications } from '~/composables/users'
|
||||
|
||||
const supportsPushNotifications = typeof window !== 'undefined'
|
||||
&& 'serviceWorker' in navigator
|
||||
&& 'PushManager' in window
|
||||
&& 'getKey' in PushSubscription.prototype
|
||||
&& 'serviceWorker' in navigator
|
||||
&& 'PushManager' in window
|
||||
&& 'getKey' in PushSubscription.prototype
|
||||
|
||||
export const usePushManager = () => {
|
||||
const masto = useMasto()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue