mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix posting privacy on secondary button with missing description confirmation dialog
This commit is contained in:
parent
e53622442c
commit
531658d6cf
@ -123,7 +123,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
// Submit unless there are media with missing descriptions
|
||||
if (mediaDescriptionConfirmation && onMediaDescriptionConfirm && media && media.some(item => !item.get('description'))) {
|
||||
const firstWithoutDescription = media.find(item => !item.get('description'));
|
||||
onMediaDescriptionConfirm(this.context.router ? this.context.router.history : null, firstWithoutDescription.get('id'));
|
||||
onMediaDescriptionConfirm(this.context.router ? this.context.router.history : null, firstWithoutDescription.get('id'), overriddenVisibility);
|
||||
} else if (onSubmit) {
|
||||
if (onChangeVisibility && overriddenVisibility) {
|
||||
onChangeVisibility(overriddenVisibility);
|
||||
|
@ -114,11 +114,16 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
dispatch(changeComposeVisibility(value));
|
||||
},
|
||||
|
||||
onMediaDescriptionConfirm(routerHistory, mediaId) {
|
||||
onMediaDescriptionConfirm(routerHistory, mediaId, overriddenVisibility = null) {
|
||||
dispatch(openModal('CONFIRM', {
|
||||
message: intl.formatMessage(messages.missingDescriptionMessage),
|
||||
confirm: intl.formatMessage(messages.missingDescriptionConfirm),
|
||||
onConfirm: () => dispatch(submitCompose(routerHistory)),
|
||||
onConfirm: () => {
|
||||
if (overriddenVisibility) {
|
||||
dispatch(changeComposeVisibility(overriddenVisibility));
|
||||
};
|
||||
dispatch(submitCompose(routerHistory));
|
||||
},
|
||||
secondary: intl.formatMessage(messages.missingDescriptionEdit),
|
||||
onSecondary: () => dispatch(openModal('FOCAL_POINT', { id: mediaId })),
|
||||
onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_missing_media_description'], false)),
|
||||
|
Loading…
Reference in New Issue
Block a user