fix: use html content for redrafting

zio/stable
三咲智子 2023-01-01 23:30:21 +08:00
parent ca1b7169f1
commit d62292d219
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
2 changed files with 4 additions and 4 deletions

View File

@ -71,8 +71,8 @@ const deleteAndRedraft = async () => {
} }
removeCachedStatus(status.id) removeCachedStatus(status.id)
const { text } = await masto.statuses.remove(status.id) await masto.statuses.remove(status.id)
openPublishDialog('dialog', await getDraftFromStatus(status, text), true) openPublishDialog('dialog', await getDraftFromStatus(status), true)
} }
const reply = () => { const reply = () => {

View File

@ -28,9 +28,9 @@ export function getDefaultDraft(options: Partial<Draft['params'] & Omit<Draft, '
} }
} }
export async function getDraftFromStatus(status: Status, text?: null | string): Promise<Draft> { export async function getDraftFromStatus(status: Status): Promise<Draft> {
return getDefaultDraft({ return getDefaultDraft({
status: text || await convertMastodonHTML(status.content), status: await convertMastodonHTML(status.content),
mediaIds: status.mediaAttachments.map(att => att.id), mediaIds: status.mediaAttachments.map(att => att.id),
visibility: status.visibility, visibility: status.visibility,
attachments: status.mediaAttachments, attachments: status.mediaAttachments,