diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-07 08:28:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 08:28:52 +0100 |
commit | cfa9b6e13ab3c434f3901df6f614d0aa94a3d1ed (patch) | |
tree | e303778680cdd80ad5a31ec5fb3b28ba5dc834ef /app/javascript/mastodon/actions/compose.js | |
parent | e26d5ca923353c9cd61073c444c0841bae4b9664 (diff) |
Remove text requirement when media attached from statuses (#6672)
Diffstat (limited to 'app/javascript/mastodon/actions/compose.js')
-rw-r--r-- | app/javascript/mastodon/actions/compose.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index 0fe480022..130b4af23 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -96,8 +96,9 @@ export function mentionCompose(account, router) { export function submitCompose() { return function (dispatch, getState) { const status = getState().getIn(['compose', 'text'], ''); + const media = getState().getIn(['compose', 'media_attachments']); - if (!status || !status.length) { + if ((!status || !status.length) && media.size === 0) { return; } @@ -106,7 +107,7 @@ export function submitCompose() { api(getState).post('/api/v1/statuses', { status, in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null), - media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')), + media_ids: media.map(item => item.get('id')), sensitive: getState().getIn(['compose', 'sensitive']), spoiler_text: getState().getIn(['compose', 'spoiler_text'], ''), visibility: getState().getIn(['compose', 'privacy']), |