Fix not being able to author quotes with CW but no text
Some checks failed
Chromatic / Run Chromatic (push) Has been cancelled

This commit is contained in:
Claire 2025-09-17 15:13:27 +02:00
parent 28be5a199f
commit 62ae3e520d

View File

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