diff --git a/pages/@[account]/[status].vue b/pages/@[account]/[status].vue index 344efcc6..382a94cc 100644 --- a/pages/@[account]/[status].vue +++ b/pages/@[account]/[status].vue @@ -7,11 +7,11 @@ const id = $(computedEager(() => route.params.status as string)) const main = ref(null) let bottomSpace = $ref(0) -const { data: status, refresh: refreshStatus } = useAsyncData(async () => ( +const { data: status, pending, refresh: refreshStatus } = useAsyncData(async () => ( window.history.state?.status as Status | undefined) ?? await fetchStatus(id), ) -const { data: context, pending, refresh: refreshContext } = useAsyncData(`context:${id}`, () => useMasto().statuses.fetchContext(id)) +const { data: context, pending: pendingContext, refresh: refreshContext } = useAsyncData(`context:${id}`, () => useMasto().statuses.fetchContext(id)) const replyDraft = $computed(() => status.value ? getReplyDraft(status.value) : null) @@ -27,8 +27,8 @@ function scrollTo() { onMounted(scrollTo) -if (pending) { - watchOnce(pending, async () => { +if (pendingContext) { + watchOnce(pendingContext, async () => { await nextTick() scrollTo() }) @@ -44,37 +44,41 @@ onReactivated(() => {