Fix not being able to author quotes with CW but no text (#36153)

Co-authored-by: diondiondion <mail@diondiondion.com>
This commit is contained in:
Claire 2025-09-25 11:25:00 +02:00 committed by GitHub
parent 719b2de3c3
commit 66686994c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,8 +194,10 @@ export function submitCompose(successCallback) {
const status = getState().getIn(['compose', 'text'], '');
const media = getState().getIn(['compose', 'media_attachments']);
const statusId = getState().getIn(['compose', 'id'], null);
const hasQuote = !!getState().getIn(['compose', 'quoted_status_id']);
const spoiler_text = getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '';
if ((!status || !status.length) && media.size === 0) {
if (!(status?.length || media.size !== 0 || (hasQuote && spoiler_text?.length))) {
return;
}
@ -227,11 +229,11 @@ export function submitCompose(successCallback) {
method: statusId === null ? 'post' : 'put',
data: {
status,
spoiler_text,
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
media_ids: media.map(item => item.get('id')),
media_attributes,
sensitive: getState().getIn(['compose', 'sensitive']),
spoiler_text: getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '',
visibility: visibility,
poll: getState().getIn(['compose', 'poll'], null),
language: getState().getIn(['compose', 'language']),