[Glitch] Fix WebUI mistakenly allowing to attach quotes when editing
Port 156f031ed046244b26016df92dbf2c72d3b23c3d to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
8d1e67b6b2
commit
7330ec670b
@ -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;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user