mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-24 18:26:17 +03:00
11 lines
348 B
TypeScript
11 lines
348 B
TypeScript
import type { ElkMasto } from '~/types'
|
|
|
|
export const useMasto = () => useNuxtApp().$masto as ElkMasto
|
|
|
|
export const isMastoInitialised = computed(() => process.client && useMasto().loggedIn.value)
|
|
|
|
export const onMastoInit = (cb: () => unknown) => {
|
|
watchOnce(isMastoInitialised, () => {
|
|
cb()
|
|
}, { immediate: isMastoInitialised.value })
|
|
}
|