Fix WebUI mistakenly allowing to attach quotes when editing (#36464)
This commit is contained in:
@@ -21,6 +21,10 @@ import { importFetchedStatuses } from './importer';
|
|||||||
import { openModal } from './modal';
|
import { openModal } from './modal';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
|
quoteErrorEdit: {
|
||||||
|
id: 'quote_error.edit',
|
||||||
|
defaultMessage: 'Quotes cannot be added when editing a post.',
|
||||||
|
},
|
||||||
quoteErrorUpload: {
|
quoteErrorUpload: {
|
||||||
id: 'quote_error.upload',
|
id: 'quote_error.upload',
|
||||||
defaultMessage: 'Quoting is not allowed with media attachments.',
|
defaultMessage: 'Quoting is not allowed with media attachments.',
|
||||||
@@ -124,7 +128,9 @@ export const quoteComposeByStatus = createAppThunk(
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (composeState.get('poll')) {
|
if (composeState.get('id')) {
|
||||||
|
dispatch(showAlert({ message: messages.quoteErrorEdit }));
|
||||||
|
} else if (composeState.get('poll')) {
|
||||||
dispatch(showAlert({ message: messages.quoteErrorPoll }));
|
dispatch(showAlert({ message: messages.quoteErrorPoll }));
|
||||||
} else if (
|
} else if (
|
||||||
composeState.get('is_uploading') ||
|
composeState.get('is_uploading') ||
|
||||||
@@ -184,7 +190,8 @@ export const pasteLinkCompose = createDataLoadingThunk(
|
|||||||
composeState.get('quoted_status_id') ||
|
composeState.get('quoted_status_id') ||
|
||||||
composeState.get('is_submitting') ||
|
composeState.get('is_submitting') ||
|
||||||
composeState.get('poll') ||
|
composeState.get('poll') ||
|
||||||
composeState.get('is_uploading')
|
composeState.get('is_uploading') ||
|
||||||
|
composeState.get('id')
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -753,6 +753,7 @@
|
|||||||
"privacy.unlisted.short": "Quiet public",
|
"privacy.unlisted.short": "Quiet public",
|
||||||
"privacy_policy.last_updated": "Last updated {date}",
|
"privacy_policy.last_updated": "Last updated {date}",
|
||||||
"privacy_policy.title": "Privacy Policy",
|
"privacy_policy.title": "Privacy Policy",
|
||||||
|
"quote_error.edit": "Quotes cannot be added when editing a post.",
|
||||||
"quote_error.poll": "Quoting is not allowed with polls.",
|
"quote_error.poll": "Quoting is not allowed with polls.",
|
||||||
"quote_error.quote": "Only one quote at a time is allowed.",
|
"quote_error.quote": "Only one quote at a time is allowed.",
|
||||||
"quote_error.unauthorized": "You are not authorized to quote this post.",
|
"quote_error.unauthorized": "You are not authorized to quote this post.",
|
||||||
|
|||||||
Reference in New Issue
Block a user