Merge remote-tracking branch 'parent/main' into upstream-20240128

This commit is contained in:
KMY 2025-01-31 08:52:03 +09:00
commit bd5b417d2b
107 changed files with 795 additions and 246 deletions

View file

@ -11,7 +11,9 @@ import {
insertExpirationCompose,
insertFeaturedTagCompose,
uploadCompose,
} from '../../../actions/compose';
} from 'mastodon/actions/compose';
import { openModal } from 'mastodon/actions/modal';
import ComposeForm from '../components/compose_form';
const mapStateToProps = state => ({
@ -29,6 +31,7 @@ const mapStateToProps = state => ({
isChangingUpload: state.getIn(['compose', 'is_changing_upload']),
isUploading: state.getIn(['compose', 'is_uploading']),
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
missingAltText: state.getIn(['compose', 'media_attachments']).some(media => ['image', 'gifv'].includes(media.get('type')) && (media.get('description') ?? '').length === 0),
isInReply: state.getIn(['compose', 'in_reply_to']) !== null,
lang: state.getIn(['compose', 'language']),
circleId: state.getIn(['compose', 'circle_id']),
@ -41,8 +44,15 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(changeCompose(text));
},
onSubmit () {
dispatch(submitCompose());
onSubmit (missingAltText) {
if (missingAltText) {
dispatch(openModal({
modalType: 'CONFIRM_MISSING_ALT_TEXT',
modalProps: {},
}));
} else {
dispatch(submitCompose());
}
},
onClearSuggestions () {