mirror of
https://github.com/mastodon/mastodon.git
synced 2026-10-19 09:11:17 -05:00
Show Save when editing a post (#40865)
This commit is contained in:
@@ -41,12 +41,24 @@ export const ComposeFooter: React.FC<{ onEmojiPick: OnEmojiPick }> = ({
|
||||
const isSubmitting = useAppSelector(
|
||||
(state) => !!state.compose.get('is_submitting'),
|
||||
);
|
||||
const isEditing = useAppSelector((state) => !!state.compose.get('id'));
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const handlePoll = useCallback(() => {
|
||||
dispatch(addPoll());
|
||||
}, [dispatch]);
|
||||
|
||||
let publishText = (
|
||||
<FormattedMessage id='compose.publish' defaultMessage='Publish' />
|
||||
);
|
||||
if (isEditing) {
|
||||
publishText = <FormattedMessage id='compose.save' defaultMessage='Save' />;
|
||||
} else if (type === 'message' || type === 'replyPrivate') {
|
||||
publishText = (
|
||||
<FormattedMessage id='compose.message.publish' defaultMessage='Send' />
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<footer className={classes.footer}>
|
||||
<ComposeUploadButton disabled={hasQuote} />
|
||||
@@ -86,14 +98,7 @@ export const ComposeFooter: React.FC<{ onEmojiPick: OnEmojiPick }> = ({
|
||||
type='submit'
|
||||
loading={isSubmitting}
|
||||
>
|
||||
{type !== 'message' && type !== 'replyPrivate' ? (
|
||||
<FormattedMessage id='compose.publish' defaultMessage='Publish' />
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id='compose.message.publish'
|
||||
defaultMessage='Send'
|
||||
/>
|
||||
)}
|
||||
{publishText}
|
||||
</Button>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -575,6 +575,7 @@
|
||||
"compose.reply.title.new": "New reply",
|
||||
"compose.reply_private.title.edit": "Edit private reply",
|
||||
"compose.reply_private.title.new": "New private reply",
|
||||
"compose.save": "Save",
|
||||
"compose.saved.body": "Post saved.",
|
||||
"compose.sensitive.label": "Sensitive content",
|
||||
"compose.sensitive.text": "Content warning",
|
||||
|
||||
Reference in New Issue
Block a user