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

This commit is contained in:
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}`, { openPublishDialog(`edit-${status.id}`, {
...await getDraftFromStatus(status), ...await getDraftFromStatus(status),
editingStatus: status, editingStatus: status,
}) }, true)
} }
</script> </script>

View file

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