mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 08:19:05 +00:00
[Glitch] Add reminder when about to post without alt text in web UI
Port 1e70da5e3c to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -10,6 +10,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
|
||||
import { length } from 'stringz';
|
||||
|
||||
import { missingAltTextModal } from 'flavours/glitch/initial_state';
|
||||
|
||||
import AutosuggestInput from '../../../components/autosuggest_input';
|
||||
import AutosuggestTextarea from '../../../components/autosuggest_textarea';
|
||||
import { Button } from '../../../components/button';
|
||||
@@ -72,9 +74,8 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
autoFocus: PropTypes.bool,
|
||||
withoutNavigation: PropTypes.bool,
|
||||
anyMedia: PropTypes.bool,
|
||||
missingAltText: PropTypes.bool,
|
||||
media: ImmutablePropTypes.list,
|
||||
mediaDescriptionConfirmation: PropTypes.bool,
|
||||
onMediaDescriptionConfirm: PropTypes.func.isRequired,
|
||||
isInReply: PropTypes.bool,
|
||||
singleColumn: PropTypes.bool,
|
||||
lang: PropTypes.string,
|
||||
@@ -131,17 +132,11 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
this.props.onSubmit(missingAltTextModal && this.props.missingAltText, overridePrivacy);
|
||||
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// Submit unless there are media with missing descriptions
|
||||
if (this.props.mediaDescriptionConfirmation && this.props.media && this.props.media.some(item => !item.get('description'))) {
|
||||
const firstWithoutDescription = this.props.media.find(item => !item.get('description'));
|
||||
this.props.onMediaDescriptionConfirm(firstWithoutDescription.get('id'), overridePrivacy);
|
||||
} else {
|
||||
this.props.onSubmit(overridePrivacy);
|
||||
}
|
||||
};
|
||||
|
||||
handleSecondarySubmit = (e) => {
|
||||
|
||||
Reference in New Issue
Block a user