mirror of
https://github.com/vector-im/element-web.git
synced 2025-10-14 17:02:17 +02:00
invert and rename changed to saveDisabled for clarity
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
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…
x
Reference in New Issue
Block a user