diff --git a/packages/pl-fe/src/locales/en.json b/packages/pl-fe/src/locales/en.json index 8b5de99de..274da062a 100644 --- a/packages/pl-fe/src/locales/en.json +++ b/packages/pl-fe/src/locales/en.json @@ -611,9 +611,10 @@ "confirmations.cancel.confirm": "Discard", "confirmations.cancel.heading": "Discard post", "confirmations.cancel.message": "Are you sure you want to cancel creating this post?", + "confirmations.cancel_draft.heading": "Discard draft changes", "confirmations.cancel_editing.confirm": "Cancel editing", "confirmations.cancel_editing.heading": "Cancel post editing", - "confirmations.cancel_editing.message": "Are you sure you want to cancel editing this post? All changes will be lost.", + "confirmations.cancel_editing.message": "Are you sure you want to cancel editing this draft post? All changes will be lost.", "confirmations.cancel_editing.save_draft": "Save draft", "confirmations.delete.confirm": "Delete", "confirmations.delete.heading": "Delete post", diff --git a/packages/pl-fe/src/modals/compose-modal.tsx b/packages/pl-fe/src/modals/compose-modal.tsx index bfdbaa993..98eae4e24 100644 --- a/packages/pl-fe/src/modals/compose-modal.tsx +++ b/packages/pl-fe/src/modals/compose-modal.tsx @@ -31,7 +31,7 @@ const ComposeModal: React.FC = ({ onClose, c const compose = useCompose(composeId); const { openModal } = useModalsStore(); - const { id: statusId, privacy, in_reply_to: inReplyTo, quote, group_id: groupId } = compose!; + const { id: statusId, privacy, in_reply_to: inReplyTo, quote, group_id: groupId } = compose; const { isDragging, isDraggedOver } = useDraggedFiles(node, (files) => { dispatch(uploadCompose(composeId, files, intl)); @@ -42,10 +42,14 @@ const ComposeModal: React.FC = ({ onClose, c openModal('CONFIRM', { heading: statusId ? - : , + : compose.draft_id + ? + : , message: statusId ? - : , + : compose.draft_id + ? + : , confirm: intl.formatMessage(statusId ? messages.cancelEditing : messages.confirm), onConfirm: () => { onClose('COMPOSE');