diff --git a/app/soapbox/containers/status_container.js b/app/soapbox/containers/status_container.js
index 0b812e033..cbb00e84d 100644
--- a/app/soapbox/containers/status_container.js
+++ b/app/soapbox/containers/status_container.js
@@ -145,7 +145,7 @@ const mapDispatchToProps = (dispatch, { intl }) => {
} else {
dispatch(openModal('CONFIRM', {
icon: withRedraft ? require('@tabler/icons/icons/edit.svg') : require('@tabler/icons/icons/trash.svg'),
- heading: intl.formatMessage(withRedraft ? messages.redraftHeading : messages.deleteHeading),
+ heading: intl.formatMessage(withRedraft ? messages.redraftHeading : messages.deleteHeading),
message: intl.formatMessage(withRedraft ? messages.redraftMessage : messages.deleteMessage),
confirm: intl.formatMessage(withRedraft ? messages.redraftConfirm : messages.deleteConfirm),
onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)),
diff --git a/app/soapbox/features/scheduled_statuses/components/scheduled_status.js b/app/soapbox/features/scheduled_statuses/components/scheduled_status.js
index 2295a0d70..f7d6a8151 100644
--- a/app/soapbox/features/scheduled_statuses/components/scheduled_status.js
+++ b/app/soapbox/features/scheduled_statuses/components/scheduled_status.js
@@ -66,10 +66,12 @@ class ScheduledStatus extends ImmutablePureComponent {
collapsable
/>
-
+ {status.get('media_attachments').size > 0 && (
+
+ )}
{status.get('poll') && }
diff --git a/app/soapbox/features/scheduled_statuses/components/scheduled_status_action_bar.js b/app/soapbox/features/scheduled_statuses/components/scheduled_status_action_bar.js
index f505eeacd..780c46797 100644
--- a/app/soapbox/features/scheduled_statuses/components/scheduled_status_action_bar.js
+++ b/app/soapbox/features/scheduled_statuses/components/scheduled_status_action_bar.js
@@ -6,10 +6,15 @@ import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types';
import IconButton from 'soapbox/components/icon_button';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
+import { openModal } from 'soapbox/actions/modal';
import { cancelScheduledStatus } from 'soapbox/actions/scheduled_statuses';
+import { getSettings } from 'soapbox/actions/settings';
const messages = defineMessages({
cancel: { id: 'scheduled_status.cancel', defaultMessage: 'Cancel' },
+ deleteConfirm: { id: 'confirmations.scheduled_status_delete.confirm', defaultMessage: 'Cancel' },
+ deleteHeading: { id: 'confirmations.scheduled_status_delete.heading', defaultMessage: 'Cancel scheduled post' },
+ deleteMessage: { id: 'confirmations.scheduled_status_delete.message', defaultMessage: 'Are you sure you want to cancel this scheduled post?' },
});
const mapStateToProps = state => {
@@ -19,8 +24,26 @@ const mapStateToProps = state => {
};
};
-export default @connect(mapStateToProps, null, null, { forwardRef: true })
-@injectIntl
+const mapDispatchToProps = (dispatch, { intl }) => ({
+ onCancelClick: (status) => {
+ dispatch((_, getState) => {
+
+ const deleteModal = getSettings(getState()).get('deleteModal');
+ if (!deleteModal) {
+ dispatch(cancelScheduledStatus(status.get('id')));
+ } else {
+ dispatch(openModal('CONFIRM', {
+ icon: require('@tabler/icons/icons/calendar-stats.svg'),
+ heading: intl.formatMessage(messages.deleteHeading),
+ message: intl.formatMessage(messages.deleteMessage),
+ confirm: intl.formatMessage(messages.deleteConfirm),
+ onConfirm: () => dispatch(cancelScheduledStatus(status.get('id'))),
+ }));
+ }
+ });
+ },
+});
+
class ScheduledStatusActionBar extends ImmutablePureComponent {
static contextTypes = {
@@ -31,11 +54,13 @@ class ScheduledStatusActionBar extends ImmutablePureComponent {
status: ImmutablePropTypes.map.isRequired,
intl: PropTypes.object.isRequired,
me: SoapboxPropTypes.me,
+ onCancelClick: PropTypes.func.isRequired,
};
handleCancelClick = e => {
- const { status, dispatch } = this.props;
- dispatch(cancelScheduledStatus(status.get('id')));
+ const { status, onCancelClick } = this.props;
+
+ onCancelClick(status);
}
render() {
@@ -56,3 +81,6 @@ class ScheduledStatusActionBar extends ImmutablePureComponent {
}
}
+
+
+export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ScheduledStatusActionBar));
diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json
index a0f63e0ad..848bcbfe5 100644
--- a/app/soapbox/locales/pl.json
+++ b/app/soapbox/locales/pl.json
@@ -302,6 +302,9 @@
"confirmations.register.needs_confirmation": "Sprawdź swoją skrzynkę na {email}, aby znaleźć instrukcje potwierdzania. Musisz zweryfikować swój adres e-mail, aby kontynuować.",
"confirmations.reply.confirm": "Odpowiedz",
"confirmations.reply.message": "W ten sposób utracisz wpis który obecnie tworzysz. Czy na pewno chcesz to zrobić?",
+ "confirmations.scheduled_status_delete.confirm": "Anuluj",
+ "confirmations.scheduled_status_delete.heading": "Anuluj zaplanowany wpis",
+ "confirmations.scheduled_status_delete.message": "Czy na pewno chcesz anulować ten zaplanowany wpis?",
"confirmations.unfollow.confirm": "Przestań śledzić",
"confirmations.unfollow.message": "Czy na pewno zamierzasz przestać śledzić {name}?",
"crypto_donate.explanation_box.message": "{siteTitle} przyjmuje darowizny w kryptowalutach. Możesz wysłać darowiznę na jeden z poniższych adresów. Dziękujemy za Wasze wsparcie!",
diff --git a/app/soapbox/reducers/timelines.js b/app/soapbox/reducers/timelines.js
index 616152248..b9b633b50 100644
--- a/app/soapbox/reducers/timelines.js
+++ b/app/soapbox/reducers/timelines.js
@@ -300,8 +300,10 @@ const handleExpandFail = (state, timelineId) => {
export default function timelines(state = initialState, action) {
switch(action.type) {
case STATUS_CREATE_REQUEST:
+ if (action.params.scheduled_at) return state;
return importPendingStatus(state, action.params, action.idempotencyKey);
case STATUS_CREATE_SUCCESS:
+ if (action.status.scheduled_at) return state;
return importStatus(state, action.status, action.idempotencyKey);
case TIMELINE_EXPAND_REQUEST:
return setLoading(state, action.timeline, true);