fix: use html content for redrafting

This commit is contained in:
三咲智子 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)
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 = () => {

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({
status: text || await convertMastodonHTML(status.content),
status: await convertMastodonHTML(status.content),
mediaIds: status.mediaAttachments.map(att => att.id),
visibility: status.visibility,
attachments: status.mediaAttachments,