take dirty-flag into account for editing

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-06-29 06:52:19 +01:00
parent bf9353f3af
commit e591d3ef76

View File

@ -189,10 +189,10 @@ export default class MessageEditor extends React.Component {
// 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 (oldContent["msgtype"] === newContent["msgtype"] && oldContent["body"] === newContent["body"] && if (!this._hasModifications ||
(oldContent["msgtype"] === newContent["msgtype"] && oldContent["body"] === newContent["body"] &&
oldContent["format"] === newContent["format"] && oldContent["format"] === newContent["format"] &&
oldContent["formatted_body"] === newContent["formatted_body"]) { oldContent["formatted_body"] === newContent["formatted_body"])) {
console.log("skipping");
this._cancelEdit(); this._cancelEdit();
return; return;
} }