refactor: inject masto instance via nuxt app (#134)

This commit is contained in:
Daniel Roe 2022-11-26 15:42:58 +00:00 committed by GitHub
parent 5c60497421
commit 39b005899e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 67 additions and 48 deletions

View file

@ -6,7 +6,7 @@ const id = $computed(() => route.params.status as string)
const main = ref<Component | null>(null)
const status = window.history.state?.status ?? await fetchStatus(id)
const { data: context } = useAsyncData(`context:${id}`, () => masto.statuses.fetchContext(id))
const { data: context } = useAsyncData(`context:${id}`, () => useMasto().statuses.fetchContext(id))
const unsubscribe = watch(context, async (context) => {
if (context) {
const statusElement = document.querySelector(`#status-${id}`)