feat: cache for publish widget

This commit is contained in:
Anthony Fu 2022-11-21 14:55:31 +08:00
parent 5d5cdebb56
commit 193d1cf5c5
9 changed files with 149 additions and 43 deletions

View file

@ -1,8 +1,4 @@
<script setup lang="ts">
const props = defineProps<{
modelValue?: boolean
}>()
const params = useRoute().params
const id = computed(() => params.post as string)
@ -16,7 +12,17 @@ const { data: context } = await useAsyncData(`${id}-context`, () => masto.status
<StatusCard :status="comment" border="t border" pt-4 />
</template>
<StatusDetails :status="status" border="t border" pt-4 />
<div border="t border" p6 flex gap-4>
<img :src="status?.account.avatar" rounded w-10 h-10 bg-gray:10>
<PublishWidget
w-full
:draft-key="`reply-${id}`"
:placeholder="`Reply to ${status?.account?.displayName || status?.account?.acct || 'this thread'}`"
:in-reply-to-id="id"
/>
</div>
<template v-for="comment of context?.descendants" :key="comment.id">
<StatusCard :status="comment" pt-4 />
<StatusCard :status="comment" border="t border" pt-4 />
</template>
</template>