mirror of https://github.com/vector-im/riot-web
invert and rename changed to saveDisabled for clarity
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
2ff98b7c1f
commit
792b70913c
|
@ -114,7 +114,7 @@ export default class EditMessageComposer extends React.Component {
|
||||||
this._editorRef = null;
|
this._editorRef = null;
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
changed: false,
|
saveDisabled: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,12 +247,12 @@ export default class EditMessageComposer extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onChange = () => {
|
_onChange = () => {
|
||||||
if (this.state.changed || !this._editorRef || !this._editorRef.isModified()) {
|
if (!this.state.saveDisabled || !this._editorRef || !this._editorRef.isModified()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
changed: true,
|
saveDisabled: false,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ export default class EditMessageComposer extends React.Component {
|
||||||
/>
|
/>
|
||||||
<div className="mx_EditMessageComposer_buttons">
|
<div className="mx_EditMessageComposer_buttons">
|
||||||
<AccessibleButton kind="secondary" onClick={this._cancelEdit}>{_t("Cancel")}</AccessibleButton>
|
<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")}
|
{_t("Save")}
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue