From 252ea948d56b72c40bf41b991cf53c97dc023dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Tue, 27 Feb 2024 10:14:54 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=E3=83=A1=E3=83=87=E3=82=A3=E3=82=A2?= =?UTF-8?q?=E3=82=92=E5=B8=B8=E3=81=AB=E9=96=B2=E8=A6=A7=E6=B3=A8=E6=84=8F?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=E8=A8=AD=E5=AE=9A=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E4=BA=BA=E3=81=8C=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=83=AD=E3=83=BC=E3=83=89=E6=99=82?= =?UTF-8?q?=E3=80=81=E9=96=B2=E8=A6=A7=E6=B3=A8=E6=84=8F=E3=82=92=E5=A4=96?= =?UTF-8?q?=E3=81=99=E6=89=8B=E6=AE=B5=E3=81=8C=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=20(#613)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/mastodon/actions/compose.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index d8c521dc222a06..03392a8c792fec 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -213,7 +213,7 @@ export function submitCompose(routerHistory) { in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null), media_ids: media.map(item => item.get('id')), media_attributes, - sensitive: media.size > 0 ? getState().getIn(['compose', 'sensitive']) : false, + sensitive: media.size > 0 ? getState().getIn(['compose', 'spoiler']) : false, spoiler_text: getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '', markdown: getState().getIn(['compose', 'markdown']), visibility: getState().getIn(['compose', 'privacy']), @@ -306,6 +306,8 @@ export function uploadCompose(files) { const uploadLimit = 4; const media = getState().getIn(['compose', 'media_attachments']); const pending = getState().getIn(['compose', 'pending_media_attachments']); + const defaultSensitive = getState().getIn(['compose', 'default_sensitive']); + const spoiler = getState().getIn(['compose', 'spoiler']); const progress = new Array(files.length).fill(0); let total = Array.from(files).reduce((a, v) => a + v.size, 0); @@ -334,6 +336,10 @@ export function uploadCompose(files) { if (status === 200) { dispatch(uploadComposeSuccess(data, file)); + + if (defaultSensitive && !spoiler) { + dispatch(changeComposeSpoilerness()); + } } else if (status === 202) { dispatch(uploadComposeProcessing());