fix(#480): keep content warning when editing a status (#492)

zio/stable
Sebastian Di Luzio 2022-12-21 15:21:45 +01:00 committed by GitHub
parent f542011b55
commit ed7989cc2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -85,7 +85,7 @@ async function editStatus() {
openPublishDialog(`edit-${status.id}`, {
...await getDraftFromStatus(status),
editingStatus: status,
})
}, true)
}
</script>

View File

@ -11,6 +11,8 @@ export function getDefaultDraft(options: Partial<Draft['params'] & Omit<Draft, '
visibility = 'public',
attachments = [],
initialText = '',
sensitive = false,
spoilerText = '',
} = options
return {
@ -18,6 +20,8 @@ export function getDefaultDraft(options: Partial<Draft['params'] & Omit<Draft, '
status,
inReplyToId,
visibility,
sensitive,
spoilerText,
},
attachments,
initialText,
@ -30,6 +34,8 @@ export async function getDraftFromStatus(status: Status, text?: null | string):
mediaIds: status.mediaAttachments.map(att => att.id),
visibility: status.visibility,
attachments: status.mediaAttachments,
sensitive: status.sensitive,
spoilerText: status.spoilerText,
})
}