From e5a05a92107271ea8f24ac9813b511b02c720198 Mon Sep 17 00:00:00 2001
From: 2458773093 <2458773093@protonmail.com>
Date: Fri, 23 Aug 2019 02:05:20 +0300
Subject: [PATCH] edit integration
---
app/javascript/gabsocial/actions/importer/normalizer.js | 2 +-
app/javascript/gabsocial/components/modal_root.js | 6 ++++--
.../gabsocial/features/compose/components/compose_form.js | 7 ++++---
.../features/compose/containers/compose_form_container.js | 1 +
4 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/app/javascript/gabsocial/actions/importer/normalizer.js b/app/javascript/gabsocial/actions/importer/normalizer.js
index b6c524ab..40d7abdb 100644
--- a/app/javascript/gabsocial/actions/importer/normalizer.js
+++ b/app/javascript/gabsocial/actions/importer/normalizer.js
@@ -53,7 +53,7 @@ export function normalizeStatus(status, normalOldStatus) {
// Only calculate these values when status first encountered
// Otherwise keep the ones already in the reducer
- if (normalOldStatus) {
+ if (normalOldStatus && normalOldStatus.get('content') === normalStatus.content && normalOldStatus.get('spoiler_text') === normalStatus.spoiler_text) {
normalStatus.search_index = normalOldStatus.get('search_index');
normalStatus.contentHtml = normalOldStatus.get('contentHtml');
normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');
diff --git a/app/javascript/gabsocial/components/modal_root.js b/app/javascript/gabsocial/components/modal_root.js
index fcc6278d..45017912 100644
--- a/app/javascript/gabsocial/components/modal_root.js
+++ b/app/javascript/gabsocial/components/modal_root.js
@@ -10,6 +10,7 @@ const messages = defineMessages({
});
const mapStateToProps = state => ({
+ composeId: state.getIn(['compose', 'id']),
composeText: state.getIn(['compose', 'text']),
});
@@ -30,6 +31,7 @@ class ModalRoot extends React.PureComponent {
onOpenModal: PropTypes.func.isRequired,
onCancelReplyCompose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
+ composeId: PropTypes.string,
composeText: PropTypes.string,
type: PropTypes.string,
};
@@ -48,9 +50,9 @@ class ModalRoot extends React.PureComponent {
}
handleOnClose = () => {
- const { onOpenModal, composeText, onClose, intl, type, onCancelReplyCompose } = this.props;
+ const { onOpenModal, composeText, composeId, onClose, intl, type, onCancelReplyCompose } = this.props;
- if (composeText && type == 'COMPOSE') {
+ if (!composeId && composeText && type == 'COMPOSE') {
onOpenModal('CONFIRM', {
message: