mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 00:22:42 +00:00
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:
parent
719b2de3c3
commit
66686994c1
|
@ -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?.length || media.size !== 0 || (hasQuote && 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']),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user