Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
invert and rename changed to saveDisabled for clarity
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Sep 11, 2019
1 parent 2ff98b7 commit 792b709
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/views/rooms/EditMessageComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class EditMessageComposer extends React.Component {
this._editorRef = null;

this.state = {
changed: false,
saveDisabled: true,
};
}

Expand Down Expand Up @@ -247,12 +247,12 @@ export default class EditMessageComposer extends React.Component {
}

_onChange = () => {
if (this.state.changed || !this._editorRef || !this._editorRef.isModified()) {
if (!this.state.saveDisabled || !this._editorRef || !this._editorRef.isModified()) {
return;
}

this.setState({
changed: true,
saveDisabled: false,
});
};

Expand All @@ -269,7 +269,7 @@ export default class EditMessageComposer extends React.Component {
/>
<div className="mx_EditMessageComposer_buttons">
<AccessibleButton kind="secondary" onClick={this._cancelEdit}>{_t("Cancel")}</AccessibleButton>
<AccessibleButton kind="primary" onClick={this._sendEdit} disabled={!this.state.changed}>
<AccessibleButton kind="primary" onClick={this._sendEdit} disabled={this.state.saveDisabled}>
{_t("Save")}
</AccessibleButton>
</div>
Expand Down

0 comments on commit 792b709

Please sign in to comment.