From d62292d219c200851582f01d69331b37c877ae12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Sun, 1 Jan 2023 23:30:21 +0800 Subject: [PATCH] fix: use html content for redrafting --- components/status/StatusActionsMore.vue | 4 ++-- composables/statusDrafts.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/status/StatusActionsMore.vue b/components/status/StatusActionsMore.vue index 7ab6aa99..2f9f6ba8 100644 --- a/components/status/StatusActionsMore.vue +++ b/components/status/StatusActionsMore.vue @@ -71,8 +71,8 @@ const deleteAndRedraft = async () => { } removeCachedStatus(status.id) - const { text } = await masto.statuses.remove(status.id) - openPublishDialog('dialog', await getDraftFromStatus(status, text), true) + await masto.statuses.remove(status.id) + openPublishDialog('dialog', await getDraftFromStatus(status), true) } const reply = () => { diff --git a/composables/statusDrafts.ts b/composables/statusDrafts.ts index 85585d76..b2b4101e 100644 --- a/composables/statusDrafts.ts +++ b/composables/statusDrafts.ts @@ -28,9 +28,9 @@ export function getDefaultDraft(options: Partial { +export async function getDraftFromStatus(status: Status): Promise { return getDefaultDraft({ - status: text || await convertMastodonHTML(status.content), + status: await convertMastodonHTML(status.content), mediaIds: status.mediaAttachments.map(att => att.id), visibility: status.visibility, attachments: status.mediaAttachments,