diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 1b5720bda..a3a8c56dd 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -19,6 +19,8 @@ const { expanded?: boolean }>() +const emit = defineEmits(['published']) + const { t } = useI18n() // eslint-disable-next-line prefer-const let { draft, isEmpty } = $(useDraft(draftKey, initial)) @@ -128,6 +130,7 @@ async function publish() { draft = initial() isPublishDialogOpen.value = false + emit('published') } finally { isSending = false diff --git a/composables/cache.ts b/composables/cache.ts index 37d94af7c..bb8639667 100644 --- a/composables/cache.ts +++ b/composables/cache.ts @@ -14,10 +14,10 @@ export function setCached(key: string, value: any, override = false) { cache.set(key, value) } -export function fetchStatus(id: string): Promise { +export function fetchStatus(id: string, force = false): Promise { const key = `status:${id}` const cached = cache.get(key) - if (cached) + if (cached && !force) return cached const promise = useMasto().statuses.fetch(id) .then((status) => { diff --git a/pages/@[account]/[status].vue b/pages/@[account]/[status].vue index d1aadb1d1..a625947e9 100644 --- a/pages/@[account]/[status].vue +++ b/pages/@[account]/[status].vue @@ -68,6 +68,7 @@ onReactivated(() => { :draft-key="replyDraft!.key" :initial="replyDraft!.draft" border="t base" + @published="refreshContext()" />