clear up ambiguity by poor naming

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-09-10 08:51:27 +01:00
parent e3643bf17a
commit 2ff98b7c1f

View File

@ -164,7 +164,7 @@ export default class EditMessageComposer extends React.Component {
dis.dispatch({action: 'focus_composer'}); dis.dispatch({action: 'focus_composer'});
} }
_isModifiedOrSameAsOld(newContent) { _isContentModified(newContent) {
// if nothing has changed then bail // if nothing has changed then bail
const oldContent = this.props.editState.getEvent().getContent(); const oldContent = this.props.editState.getEvent().getContent();
if (!this._editorRef.isModified() || if (!this._editorRef.isModified() ||
@ -181,12 +181,14 @@ export default class EditMessageComposer extends React.Component {
const editContent = createEditContent(this.model, editedEvent); const editContent = createEditContent(this.model, editedEvent);
const newContent = editContent["m.new_content"]; const newContent = editContent["m.new_content"];
if (this._isModifiedOrSameAsOld(newContent)) { // If content is modified then send an updated event into the room
if (this._isContentModified(newContent)) {
const roomId = editedEvent.getRoomId(); const roomId = editedEvent.getRoomId();
this._cancelPreviousPendingEdit(); this._cancelPreviousPendingEdit();
this.context.matrixClient.sendMessage(roomId, editContent); this.context.matrixClient.sendMessage(roomId, editContent);
} }
// close the event editing and focus composer
dis.dispatch({action: "edit_event", event: null}); dis.dispatch({action: "edit_event", event: null});
dis.dispatch({action: 'focus_composer'}); dis.dispatch({action: 'focus_composer'});
}; };