fix: defer loading accounts/tags until masto is initialised

This commit is contained in:
Daniel Roe 2022-12-26 15:14:48 +01:00
parent f28923f86f
commit 4e79246df3
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55
3 changed files with 8 additions and 6 deletions

View file

@ -13,9 +13,10 @@ const main = ref<ComponentPublicInstance | null>(null)
let bottomSpace = $ref(0)
const publishWidget = ref()
const { data: status, pending, refresh: refreshStatus } = useAsyncData(`status:${id}`, async () => (
window.history.state?.status as Status | undefined)
?? await fetchStatus(id),
const { data: status, pending, refresh: refreshStatus } = useAsyncData(
`status:${id}`,
async () => (window.history.state?.status as Status | undefined) ?? await fetchStatus(id),
{ watch: [isMastoInitialised], immediate: isMastoInitialised.value },
)
const masto = useMasto()
const { data: context, pending: pendingContext, refresh: refreshContext } = useAsyncData(`context:${id}`, () => masto.statuses.fetchContext(id))