mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-11 14:30:35 +00:00
[Glitch] Ensure quote policy is displayed as “Just me” when disabled because of visibility
Port 7a76f71d99 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -239,6 +239,7 @@ export function submitCompose(overridePrivacy = null, successCallback = undefine
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const visibility = overridePrivacy || getState().getIn(['compose', 'privacy']);
|
||||||
api().request({
|
api().request({
|
||||||
url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`,
|
url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`,
|
||||||
method: statusId === null ? 'post' : 'put',
|
method: statusId === null ? 'post' : 'put',
|
||||||
@@ -250,11 +251,11 @@ export function submitCompose(overridePrivacy = null, successCallback = undefine
|
|||||||
media_attributes,
|
media_attributes,
|
||||||
sensitive: getState().getIn(['compose', 'sensitive']) || (spoilerText.length > 0 && media.size !== 0),
|
sensitive: getState().getIn(['compose', 'sensitive']) || (spoilerText.length > 0 && media.size !== 0),
|
||||||
spoiler_text: spoilerText,
|
spoiler_text: spoilerText,
|
||||||
visibility: overridePrivacy || getState().getIn(['compose', 'privacy']),
|
visibility: visibility,
|
||||||
poll: getState().getIn(['compose', 'poll'], null),
|
poll: getState().getIn(['compose', 'poll'], null),
|
||||||
language: getState().getIn(['compose', 'language']),
|
language: getState().getIn(['compose', 'language']),
|
||||||
quoted_status_id: getState().getIn(['compose', 'quoted_status_id']),
|
quoted_status_id: getState().getIn(['compose', 'quoted_status_id']),
|
||||||
quote_approval_policy: getState().getIn(['compose', 'quote_policy']),
|
quote_approval_policy: visibility === 'private' || visibility === 'direct' ? 'nobody' : getState().getIn(['compose', 'quote_policy']),
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
|
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ export const VisibilityModal: FC<VisibilityModalProps> = forwardRef(
|
|||||||
items={quoteItems}
|
items={quoteItems}
|
||||||
onChange={handleQuotePolicyChange}
|
onChange={handleQuotePolicyChange}
|
||||||
classPrefix='visibility-dropdown'
|
classPrefix='visibility-dropdown'
|
||||||
current={quotePolicy}
|
current={disableQuotePolicy ? 'nobody' : quotePolicy}
|
||||||
title={intl.formatMessage(messages.buttonTitle)}
|
title={intl.formatMessage(messages.buttonTitle)}
|
||||||
disabled={disableQuotePolicy}
|
disabled={disableQuotePolicy}
|
||||||
id={quoteDropdownId}
|
id={quoteDropdownId}
|
||||||
|
|||||||
Reference in New Issue
Block a user